Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TDD & Unit Testing

TDD & Unit Testing

Avatar for Serdar Büyüktemiz

Serdar Büyüktemiz

April 17, 2015

More Decks by Serdar Büyüktemiz

Other Decks in Programming

Transcript

  1. What is Software Testing? • Software testing is a process

    used to identify the correctness and quality of developed computer software. • It includes a set of activities to find errors in software so that it could be corrected before product is released.
  2. Industry is now passing the early majority stage! Software Development

    & Adaption Lifecycle • http://en.wikipedia.org/wiki/Technology_adoption_lifecycle
  3. What does this mean? • This means in the past

    having a working software was cool, but today everyone has a working software! • The hard thing today is having a cheap maintainable code... which can be achievable only via automated processes.
  4. The History of Software Testing • IEEE 829 Standard for

    Software Test Documentation is published in 1983. • Today’s modern testing frameworks are clones of SUnit which develped by Kent Beck who is also the creator of extreme programming.
  5. Some Testing Types You May Heard • Black box testing

    • White box testing • Unit testing • Incremental integration testing • Integration testing • Functional testing • System testing • End-to-end testing • Sanity testing • Regression testing • Acceptance testing • Load testing • Stress testing • Performance testing • Usability testing • Install/uninstall testing • Recovery testing • Security testing • Compatibility testing • Comparison testing • Alpha testing • Beta testing • Exploratory Testing
  6. What is Unit Testing? • Unit testing is a software

    development process. • Units are the smallest testable parts of an application. • Units independently test a proper operation.
  7. Why Unit Testing Is Important? • A testable code is

    manitainable code. • When you code the unit tests you can automate the software testing. • It dramaticly improves the quality.
  8. Unit Testing Advices • It should be easy to implement.

    • It should be automated, should be easy to repeat. • Anyone should be able to run it with a single click. • It should be isolated. (a unit test can not be effected from other tests, it should be independent…) • When it fails, failing reason should be obvious. • It should run quick.
  9. What do you mean with TDD? • I mean Test

    Driven Design. • In TDD, Test is the first thing you do to design the software architecture!
  10. The technique of TDD 1.Write a failing test for a

    function (Red) 2.Make the test pass (Green) 3.Refactor your code (Refactor)
  11. Some Tools for Testing in .Net • Nunit • FakeItEasy

    • Selenium • SpecFlow • Ncrunch • Resharper • dotCover
  12. UNIT TESTING DEMO A basic money amount multiply method A

    test driven designed fibonacci squence method