Student is explained that Test Driven Development is an art and that there is no absolute right or wrong way to do it. A brief example is provided. This video also discusses that as a developer, the student should not only to be able to code well but also defend why they chose their approach and that by doing this well, the perspective from which they were thinking should become clearer to others.
- View Offline
- When you really think about it,…coding in general is an art,…and if you can accept that,…testing is also an art because the choices you make…to test your code, have a creative element to them.…Choices made when applying solid principles…may vary from one developer to another.…We may have two testing approaches…that render the same result,…but the first might be shorter and more time efficient…for a deadline, but at the same time,…the second approach might be more complete.…As a developer, your job is not only to be able…to code well, but also defend why you've chosen…your approach.…
Do this well, then the perspective from which…you are thinking, should become clearer to others,…and perspective is what art is all about.…
In this course, Reynald Adolphe explains the principles of test-driven development and shows how to apply them to two different C# workflows. First, he creates a new test-driven project. He writes the test cases before the code to drive the design of the program. In the second scenario, he writes test cases for an existing C# project, to find bugs before it goes live. Along the way, Reynald uses Microsoft's MSTest, but he also introduces other testing tools (such as the unit testing framework xUnit and the mocking framework Moq) and theories (such as the red-green-refactor mantra and SOLID principles) that make test-driven development so efficient.
- Different approaches to testing
- Using testing tools and mocking frameworks
- Creating a simple C# test-driven project
- Adding a failing test
- Updating tests to pass
- Refactoring code
- Using Moq to test data