Lecture 3.1-1.pdf - Informatics 115 Software Testing Analysis and Quality Assurance Lecture 3.1 Professor Iftekhar Ahmed Department of Informatics

Lecture 3.1-1.pdf - Informatics 115 Software Testing...

This preview shows page 1 - 14 out of 63 pages.

Informatics 115: Software Testing, Analysis, and Quality Assurance Lecture 3.1 Professor Iftekhar Ahmed Department of Informatics
Image of page 1
2 Behavior Driven Development
Image of page 2
3 Read Dan North article: "Introducing BDD"
Image of page 3
4 Behavior Driven Development (BDD) A more verification-focused form of acceptance testing — an attempt to anticipate and automate user validation A re-framing of “testing” to put “behaviors” at the center — a focus on the behavior of the program rather than the behavior of the tester Helps as a reminder that the tester isn’t the main actor , and his/her environment and goals aren’t the main ones
Image of page 4
5 Behavior Driven Development (BDD) Motivations: Programmers needed help with TDD Knowing where to start What to test What not to test How much to test What to call their test cases How to understand why a test fails
Image of page 5
6 BDD (from North) Test method names should be sentences An expressive test name is helpful when a test fails A simple sentence template keeps test methods focused.
Image of page 6
7 BDD (from North) BDD provides a “ubiquitous language” for analysis Requirements Design Business Analysis Testing
Image of page 7
8 BDD (from North article) Behavior is a more useful word than test. Emphasize behavior over testing. Method: Write (initially failing) Test Determine (or define) the next most important behavior. Implement Functionality for Test Behavior Test Functionality against Behavior (typically using automated testing frameworks) Iterate
Image of page 8
9 BDD vs. TDD BDD often considered more high-level than TDD (which is generally thought of at a smaller unit-test level) But, not necessarily: BDD can be used at the unit-testing level, and TDD can be used at the system level Difference in focus/mindset
Image of page 9
10 BDD Forms User Story As a [X] I want [Y] so that [Z] Scenario Given some initial context (the givens), When an event occurs, then ensure some outcomes.
Image of page 10
11 Example +Title: Customer withdraws cash+ As a customer, I want to withdraw cash from an ATM, so that I don’t have to wait in line at the bank. + Scenario 1: Account is in credit+ Given the account is in credit And the card is valid And the dispenser contains cash When the customer requests cash Then ensure the account is debited And ensure cash is dispensed And ensure the card is returned + Scenario 2: Account is overdrawn past the overdraft limit+ Given the account is overdrawn And the card is valid When the customer requests cash Then ensure a rejection message is displayed And ensure cash is not dispensed And ensure the card is returned
Image of page 11
12 Finite State Machines
Image of page 12
13 Finite State Machines FSMs are graphs Nodes represent state Edges represent transitions among states Transitions often have logical expressions as guards or triggers Four Elements: - States - define behavior and may produce actions.
Image of page 13
Image of page 14

You've reached the end of your free preview.

Want to read all 63 pages?

  • Spring '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors