Featured Whitepapers
- Apples, Oranges, and Acorns - All Agile Development Tools Are Not the Same
- One's Enough for Agile Application Development Management
- Requirements Management 101 – 4 Basics Everyone Should Know
- Tips on Requirements Traceability – Learn How to Control Change and Improve Quality
- Scaling Continuous Integration to Large and Distributed Teams
|
Test Driven Development
These three points nicely define the rules, but they lack the intent of following these rules. The goal behind TDD is not just to write tests before so that you 1) don't forget to later or 2) run out of time or 3) you become lazy and just let it go or 4) that you are pressured to not write tests by external forces who don't see the benefit. These problems are addressed by using TDD but they are not the focus of TDD. Test Driven Development is more about the design of the code and the rhythm of the developer creating code. Domain Driven Design
Ubiquitous language in its simplest meaning is the attempt to bridge the gap between the language of the business and language of the system. The motive behind the ubiquitous language is that the complexity of a project can become unmanageable when a business term or concept is part of the system but is not reflected with the same language in the objects of the system. This tends to create an understanding gap between the business experts who define the behavior of the system and the developers who implement the behaviors of the system. A project that uses the concept of the ubiquitous language strives to incorporate business names, entities, and terminology into their objects. A domain model is another fundamental base of domain driven design. A complex business domain will result in a complex software project. In order to understand the business domain and translate that knowledge into an object oriented system, objects are necessary. A domain model is an attempt to capture knowledge learned about the business and turn that into objects. Note that the domain model does not have to be an exact depiction of the actual objects used in the system. Many projects maintain a "concept" domain model, which models the known entities, relationships and structure of a system. The main purpose of a domain model is to understand the business domain and build a visual depiction of knowledge so it can be shared amongst team members. It is not a detailed design diagram of the objects of the system but rather a precisely modeled understanding of the business in the form of objects. The domain model is a living diagram and is updated and maintained as understanding evolves. A knowledge rich domain essentially means that domain objects in the system contain related behavior. Many projects follow the anemic domain pattern in which their domain objects contain data with getters and setter methods but do not contain any behavior methods. The behaviors are implemented with "managers" or "controllers." DDD advocates that behaviors related to an object should be contained in that object. Several added benefits are gained from a knowledge rich domain. Behavior logic is contained in one object, often reducing duplicated code resulting in a gain in reuse. Objects are more encapsulated and follow the "tell don't ask" principle. Systems with knowledge rich domains are often more understandable and intuitive as an object manages its own data and its related behaviors can be found with that object, resulting in better maintenance. Layered Architecture is a technique in designing software in order to separate concerns of a system, reduce coupling, and to isolate the domain layer of a system. An enterprise software system indelibly has several common concerns. A user interface accepts actions from a user, data must be saved to a database, transactions must be managed to maintain integrity of data, and business logic must be implemented. The question arises of “where do all these concerns get implemented within a system.” If these concerns are flattened into the presentation layer, this can lead to brittle software where one change could trickle to several areas and possibly unrelated areas of a system, thus making maintenance a headache. Changes become unintuitive to implement and scattered across a system. Layered architecture is fundamental concept not original to domain driven design, but nicely complements the idea of separating the domain layer. Evans concisely states the essence of the pattern: Follow standard architectural patterns to provide loose coupling to the layers above. Concentrate all the code related to the domain model in one layer and isolate it from the user interface, application, and infrastructure code. The domain objects, free of the responsibility of displaying themselves, storing themselves, managing application tasks, and so forth, can be focused on expressing the domain model. This allows a model to evolve to be rich enough and clear enough to capture essential business knowledge and put it to work.
A basic principle of layering is the dependencies between layers must exist in one direction, starting from the presentation layer downward. The domain layer contains most of the business logic and is mostly accessible to the other layers. Designing a behavior rich domain layer allows for
Behavior Driven Development An example of allowing a "testing mentality" to take over your test driven development process would be as follows:
At this point I have entered the mindset of "testing" and not just the behavior of my PersonService class. If I was only worried about the behavior and abstracted myself away from implementation, the first test I create would only consider that the invocation of PersonService.findPersonByName returns a Person object named "bob", regardless of the implementation. What if we extended this example to a method that didn't return anything, i.e. it returned void? Thus, we may write a test that only verifies that a mock is called. What does this really accomplish other then satisfying code coverage and validating that you called what you intended to call. These are legitimate concerns but not "behavior driven" concerns. They are more unit testing and general "testing" concerns. In my experience, I have seen tests in projects that verify mocks and all the tests pass, but since no behavior was validated through tests the system behavior was not met. Thus we had a situation where unit tests passed, but the code had a bug. This is classic verification without validation. Essentially it is doing the right thing, but not doing the thing right. WindowControl should close windows Feature Driven Development FDD is defined by these simple steps
The first 3 steps are considered the "startup phase" and the last 2 steps are done iteratively until the project is complete. The last 2 steps are considered the "construction phase". Of course if the first three steps need to be revisited in the middle of the project, the agile spirit of FDD considers this necessary. The image below illustrates the process. Step 1 "Develop an overall model" asserts that a project should spend sufficient time developing a domain model for the problem attempting to be solved. This borrows elements from domain driven design, and well as traditional object modeling. This exercise facilitates understanding between managers, business members, and developers. It also well defines the problem and domain. The most homegrown characteristic of FDD is the concept of a feature. A feature is defined as a bite size chunk of functionality that is described in compact form, preferably in one sentence. The requirements aspect of FDD is focused on features and is most relevant in step 2 "Build a feature list." Analysis and communication must be done with a customer to generate a feature list which is of course full of features. Each feature should follow the template
Feature Driven Design blends aspects of several agile methodologies to form a simple yet effective model for constructing complex software. The well defined concept of a feature breaks requirements down into manageable portions and allows for customer input on priority and feedback. Many tools exist centered around management of requirements in the form of features and can be used to effectively run a project. Conclusion References About the Author
Nirav Assar is an agile java consultant in the Dallas/Fort Worth area. His expertise includes helping software development teams adopt agile practices, as well as designing and implementing enterprise applications using the principles of object oriented design and clean code. Nirav has worked in a variety of industries including defense, retail, government, and real estate. Along the way, he has worked with many java technologies but his favorites include spring, seam, hibernate, cruisecontrol and ejb3.0. In his spare time, he also enjoys spending time with his family, discussing philosophy and playing soccer.
Set as favorite
Bookmark
Email this
Hits: 3185 Trackback(0)Comments (1)
|
| Last Updated on Monday, 07 June 2010 11:29 |
Agile Marketplace - Announcements and Special Offers
The Business Case for ALM Transformation
Are legacy systems holding your company back? Breakthrough these technical constraints with an open and scalable environment that meets your unique business need to transform. There is no reason to be locked into an obsolete platform. The output of a number of recent transitions from legacy systems, this is practical white paper shares lessons learned and illustrates how guidance and enablement can pave the way for change.
Download this Whitepaper


Overview

