2/17/17

Review vs Tesng

• What is agile development? Debugging is twice as hard as wring the code in the first • What are frameworks you can use for agile place. Therefore, if you write the development? code as cleverly as possible, you are, by definion, not smart enough to debug it.

Brian Kernighan Tesng can never demonstrate the ______of errors absence in soware, only their ______presence

Feb 17, 2017 Sprenkle - CSCI397 1 EdsgerFeb 17, 2017 Dijkstra Sprenkle - CSCI397 2

Tesng Granularies Tesng Granularies • Unit tesng • Integraon tesng • System tesng Ø How is the whole system working? • System integraon tesng

What are the benefits of unit testing?

Feb 17, 2017 Sprenkle - CSCI397 3 Feb 17, 2017 Sprenkle - CSCI397 4

1 2/17/17

BDD: Behavior-Driven Development • It’s a behavior: everyone involved should have the same way of talking about the system and what it does. • Enough is enough: do as much planning, analysis, and design as you need, but no more. • Deliver stakeholder value: everything you do should deliver value or increase your ability to do (XP): so. • BDD is about communicaon and viewing your BEHAVIOR-DRIVEN DEVELOPMENT soware as a system with behavior.

Feb 17, 2017 Sprenkle - CSCI397 5 Feb 17, 2017 Sprenkle - CSCI397 6

Features • Feature: something that your soware should do Ø generally corresponds to a user story and a way to tell when it’s finished and that it works • User Story: Ø As a {type of user}, I want {goal} so that I {receive benefit}.

Feb 17, 2017 Sprenkle - CSCI397 7 Feb 17, 2017 Sprenkle - CSCI397 8

2 2/17/17

Mockito Mockito Pracce • Mocking framework for unit tesng in Java • Make a new Maven project Ø Update dependencies • : with BDD and XP, may want to create • mockito-core tests, but you haven’t implemented the classes • Junit yet. • hp://cs.wlu.edu/~sprenkle/cs397/examples/ Ø Use Mockito to mock the objects. mockito_examples/

Feb 17, 2017 Sprenkle - CSCI397 9 Feb 17, 2017 Sprenkle - CSCI397 10

Discussion and Analysis • How would you use this tool? • How user friendly is the tool?

Feb 17, 2017 Sprenkle - CSCI397 11

3