1 / 14

flic.kr/p/7iffKj

Testing with JUnit. http://flic.kr/p/7iffKj. Iterative Development Process. Analysis. Requirements. Design. Initial Planning. Implementation. Planning. Testing. Evaluation. Deployment. We are here. Definitions. Defect / Bug / Fault : Thing that developer did wrong

francop
Download Presentation

flic.kr/p/7iffKj

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Testing with JUnit http://flic.kr/p/7iffKj

  2. Iterative Development Process Analysis Requirements Design InitialPlanning Implementation Planning Testing Evaluation Deployment We are here

  3. Definitions • Defect/Bug/Fault: Thing that developer did wrong • Cause of program’s incorrect behavior • Error: Incorrect behavior of program • May not be observable to user • Failure: User-observable error; loss of functionality Some authors prefer to flip the above defs of fault and error

  4. More Definitions • Test/Test Case: One execution of program that may expose bug • Test Suite: Set of test cases • Often used to group related tests

  5. Decisions when designing tests • What subset of system to test? • How to choose test cases?

  6. What subset of system to test? smaller subset Unit testing: Test modules in isolation; smallest “units” of code Integration testing: Test groups of collaborating units System testing: Test the complete system larger subset

  7. Unit versus Integration Testing • Problem: Distinction is fuzzy because depends on definition of “unit”, which varies (class? method?...) • Some additional distinctions:

  8. Decisions when designing tests • What subset of system to test? • How to choose test cases?

  9. How to choose test cases? • Blackbox testing: Choose based on module’s possible inputs and outputs • Do not use code • Often test boundary cases • Whitebox testing: Uses internal logic to choose tests • Different levels of code coverage • Aka glass box testing, clear box testing • Regression testing: Keep tests that reveal old bugs • Rationale: “Fixed” bugs come back!

  10. Many higher-level testing strategies as well • Acceptance testing: Users test to see if system meets actual use requirements • Serves both validation and verification • Usability testing: Observe users using system with eye on usability of system • Test-driven development: … more next chapter … • And many more…

  11. Eclipse + JUnit demo time! http://flic.kr/p/5dfuqL

  12. JUnit Annotation Reference From http://www.vogella.com/articles/JUnit/article.html

  13. JUnit Method Reference From http://www.vogella.com/articles/JUnit/article.html

  14. JUnit Tips • If target of unit test is edu.memphis.Foo, then make test edu.memphis.test.FooTest • You can use JUnit for unit and integration tests

More Related