310 likes | 442 Views
Fitnesse and .NET. Achieving Customer Zen With Fitnesse. Overview. The problem with customers… Figuring out what customers want Executable Specifications How Fitnesse can help Fitnesse Demos Wrap-up. The Customer Problem.
E N D
Fitnesse and .NET Achieving Customer Zen With Fitnesse Achieving Customer Zen with Fitnesse and .NET
Overview • The problem with customers… • Figuring out what customers want • Executable Specifications • How Fitnesse can help • Fitnesse Demos • Wrap-up
The Customer Problem If we don’t take care of the customers, maybe they’ll stop bugging us
The Customer Problem • Customers aren’t developers • Developers aren’t (usually) customers • Customers don’t know what they want until they see it
What Customers Want • How do we show customers what they want? • In a way they can understand • In a way that elicits immediate feedback • In a way that allows them to explore • Without building entire system
What Customers Want • Mock-Ups • Screen grabs • Sketches on paper or whiteboard • Visio Diagrams • Good for initial discussions • Allows customer to explore in some fashion • Hard to keep up with the latest state of the system
What Customers Want • Prototyping • Make a throw away version • Allows customer interaction at a more concrete level • More expensive than mock-ups • Customers may not understand difference between prototype and real system • May be hard to keep up with the real system
What Customers Want • Frequent Releases • Shows customer what is finished • Shows customer the current state of the system • Hard for customer to explore with • Customer has to wait for release to play with new version • Customer can only explore GUI elements
What Customers Want • Need something between prototype and actual release • Ties domain concepts to code • Proves when feature is done – in a repeatable fashion • Customer-centric and developer friendly • Ties as closely as possible to the real system
Executable Specifications • A way of modeling specifications in a way that allows them to be executed to prove the system meets the spec • Abstract State Model • Any algorithm can be modeled at its natural abstraction level by an appropriate ASM • By being able to run the model, you can validate the algorithm
Executable Specifications • The appropriate abstraction level for business problems is usually a business (or domain) specific language • By allowing the domain language to be executable, users get fast feedback • Domain concepts can be translated directly into code
How Fitnesse Helps • Which is clearer? • This? [Test]public void CreateRoomAddsRoomToRoomList(){ Assert.AreEqual(0, chatApp.AvailableRooms.Count); chatApp.CreateRoom(“aRoom”, “aUser”); Assert.AreEqual(1, chatApp.AvailableRooms.Count); Room room = chatApp.AvailableRooms.GetRoomByName(“aRoom”); Assert.AreEqual(1, room.UserCount); Assert.IsTrue(room.Users.Contains(“aUser”));}
How Fitnesse Helps • Or this?
How Fitnesse Helps • So what is this magical Fitnesse? • Two pieces • FIT (Framework for Integration Tests) • Fitnesse • Allows specifications to be written in HTML, Excel or Wiki format • Can use any language underneath (runners for .NET, Java, Python, Ruby and others)
How Fitnesse Helps • Fitnesse • Uses Wiki format • Allows collaborative efforts between customers and developers • Is about communication first, testing second • Easy to use syntax • Straightforward to hook to the system being tested
How Fitnesse Helps • Different Types of Tables • ColumnFixture • RowFixture • DoFixture • ActionFixture • Custom Fixtures • Many others
How Fitnesse Helps • Helps solve 3 major problems • Communication • Agility • Balance • Side effect benefits • Regression tests • Domain concepts exposed
Chat Application Demo • Chat Application • Customer wants a simple chat application where users can create rooms and join existing ones • Specifications are being captured into Fitnesse fixtures and hooked to the system under test
Chat Application Demo • Specification Example
Chat Application Demo • Customer found a hole in the specification by writing Fitnesse tests • When the last user leaves, the room should be deleted
Chat Application Demo • Because the domain concepts are translated into code, the developers can quickly write the corresponding unit test
Chat Application Demo • And then get the unit test to pass by writing the code
Chat Application Demo • And because Fitnesse ties into the system under test, we can see our change meets the specification immediately
Business Rules Demo • The table based nature of Fitnesse is excellent for communicating Business Rules • If you can capture the concepts in a table form, you can write it in Fitnesse
Business Rules Demo • Business Holidays • Different businesses have different days which they may count as holidays • Interfacing with them may mean having to know what holiday applies to what business • Sounds like a good Fitnesse test!
Business Rules Demo • Fitnesse Test and Code
Business Rules Demo • Shipping Charges • Online store with shopping cart • Shipping Charges are based on order amounts • Customers get free shipping if they are over a set amount, or if they have preferred customer status
Business Rules Demo • We want an initial user list we can reuse throughout our tests
Business Rules Demo • Our other fixtures can now make use of our setup code
Wrap-up • Focus on using Fitnesse to communicate with your customers first • Then use Fitnesse as a regression testing tool • Having Fitnesse tests shouldn’t be an excuse not to write unit tests
Wrap-up • Fitnesse Resources • Fit for Developing Software by Rick Mugridge and Ward Cunningham • Fitnesse website (http://www.fitnesse.org) • Fitnesse mailing list (http://groups.yahoo.com/group/fitnesse) • Fitnesse tutorials (http://www.cornetdesign.com)