Beginning Software Craftsmanship Brendan Enrick Steve Smith

Slides:



Advertisements
Similar presentations
Extreme Programming Alexander Kanavin Lappeenranta University of Technology.
Advertisements

Local Touch – Global Reach The New Tester Matthew Eakin, Manager Managed Testing Practice Sogeti, USA.
NAUG NAUG Knowledge Evening – th February 2007.
Testing and Debugging CS221 – 2/13/09. Airline Program.
Agile Methods and Extreme Programming CSSE 376, Software Quality Assurance Rose-Hulman Institute of Technology March 23, 2007.
Extreme Programming Team Members Gowri Devi Yalamanchi Sandhya Ravi.
Computer Engineering 203 R Smith Agile Development 1/ Agile Methods What are Agile Methods? – Extreme Programming is the best known example – SCRUM.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
Notion of a Project Notes from OOSE Slides - modified.
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
CODING Research Data Management. Research Data Management Coding When writing software or analytical code it is important that others and your future.
Unit Testing Tips and Tricks: Database Interaction Louis Thomas.
By John Boal  Continuous Integration [CI] ◦ Automating the build process ◦ Build the entire system each time any new.
Pair Programming Testing 2, October 14, Administration  Project due Monday 2PM SHARP  Remember all parts of documentation (list of tests, project.
Applied Software Project Management Andrew Stellman & Jennifer Greene Applied Software Project Management Applied Software.
CONTINUOUS INTEGRATION, DELIVERY & DEPLOYMENT ONE CLICK DELIVERY.
Software Quality Assurance Lecture #8 By: Faraz Ahmed.
Michael Burnside Blog: Software Quality Assurance, Quality Engineering, and Web and Mobile Test.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
Applied Software Project Management Andrew Stellman & Jennifer Greenehttp:// Applied Software Project Management Chapter 1: Introduction.
Craig Berntson
Agile and XP Development Dan Fleck 2008 Dan Fleck 2008.
Creating a Maintainable Software Ecosystem Jeremy D. Miller November 27th, 2007.
CMSC 345 Fall 2000 Unit Testing. The testing process.
Teaching material for a course in Software Project Management & Software Engineering – part II.
111 Notion of a Project Notes from OOSE Slides – a different textbook used in the past Read/review carefully and understand.
Design and Programming Chapter 7 Applied Software Project Management, Stellman & Greene See also:
Coming up: What is Agile? XP Development Dan Fleck 2010 Dan Fleck 2010.
Software Development Software Testing. Testing Definitions There are many tests going under various names. The following is a general list to get a feel.
Pair Programming. XP Rule of Thumb “When something is difficult or painful, do it more often until it becomes easier.”
From Quality Control to Quality Assurance…and Beyond Alan Page Microsoft.
Chapter 22 Developer testing Peter J. Lane. Testing can be difficult for developers to follow  Testing’s goal runs counter to the goals of the other.
Sofia Bulgaria Summer School IST eXPERT: Best Practice on e-Project Development 30 June - 2 July 2003 eXtreme programming.
Software Construction Lecture 18 Software Testing.
Software Testing and Maintenance 1 Code Review  Introduction  How to Conduct Code Review  Practical Tips  Tool Support  Summary.
TEST-1 6. Testing & Refactoring. TEST-2 How we create classes? We think about what a class must do We focus on its implementation We write fields We write.
Goals for Presentation Explain the basics of software development methodologies Explain basic XP elements Show the structure of an XP project Give a few.
Week 14 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
Test-Driven Development Eduard Miric ă. The problem.
Using Test Driven Development Jon Kruger Blog: Twitter: JonKruger.
Extreme programming (XP) Variant of agile Takes commonsense practices to extreme levels © 2012 by Václav Rajlich1.
(1) Test Driven Development Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
Extreme Programming. Extreme Programming (XP) Formulated in 1999 by Kent Beck, Ward Cunningham and Ron Jeffries Agile software development methodology.
CSC 480 Software Engineering Extreme Programming.
(1) Introduction to Continuous Integration Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of.
Agenda: Overview of Agile testing Difference between Agile and traditional Methodology Agile Development Methodologies Extreme Programming Test Driven.
Test Driven Development Introduction Issued date: 8/29/2007 Author: Nguyen Phuc Hai.
Cruise Training Introduction of Continuous Integration.
Northwest Arkansas.Net User Group Jay Smith Tyson Foods, Inc. Unit Testing nUnit, nUnitAsp, nUnitForms.
Clean Code and How to Achieve Zero Defects Jason Jolley Director, Application Development Micro Strategies, Inc.
Software Engineering 2004 Jyrki Nummenmaa 1 Why new software methodologies The classic waterfall-model based techniques are strongly based on the.
Beginning Software Craftsmanship Brendan Enrick Steve Smith
Coming up: What is Agile? XP Development Dan Fleck 2010 Dan Fleck 2010.
1 March 12, Testing William Cohen NCSU CSC 591W March 12, 2008.
1 © Agitar Software, 2007 Automated Unit Testing with AgitarOne Presented by Eamon McCormick Senior Solutions Consultant, Agitar Software Inc. Presented.
Software Testing.
Unit Testing - solid fundamentals
Taking an Iteration Down to Code
Unit Testing & Test-Driven Development for Mere Mortals
Unit Testing & Test-Driven Development for Mere Mortals
Johanna Rothman Create Technical Excellence Chapter 9
X in [Integration, Delivery, Deployment]
What do you need to know about XP?
Software testing strategies 2
TDD adoption plan 11/20/2018.
TDD & ATDD 1/15/2019.
Applied Software Project Management
Unit Testing & Test-Driven Development for Mere Mortals
Continuous Integration
Hardware-less Testing for RAS Software
Presentation transcript:

Beginning Software Craftsmanship Brendan Enrick Steve Smith

Key Practices Automated Testing Continuous Integration Pairing

Automated Testing Tests are useless when not run Manual tests are likely to be skipped Run automated tests constantly Catch problems before committing

Kinds of Tests Unit Tests Integration Tests Acceptance Tests

Unit Tests Run in Isolation Are extremely fast Can be run constantly Can afford to have many of them

Integration Tests Test Interactions Confirm Infrastructure works as expected Slower than unit tests Can be run frequently –Ideally run before each commit

Acceptance Tests Verify behavior of entire features Slow, but still automated (ideally) Should be defined by customer –May even be written by customer Ideally run before every commit –May need to run only on scheduled basis on build server

What should we test? At least one happy path At least one sad path Expected Exceptions Boundary Conditions Code Contracts and Invariants Test all code paths –100% test coverage is useless if it doesn’t account for Cyclomatic Complexity

Arrange – Act - Assert Arrange –Set up the test’s initial state Act –Perform the action you wish to test Assert –Inspect the system or results for correctness

Two Typical Approaches State-Based Tests –Given inputs, I expect output –Black box; we don’t care how output produced Behavior-Based Tests –Concerned with workflow, actions performed –White box; cares how things are done within the system –When I call A, I expect it to call B and C –Frequently disregards state/result of operations

Why is testing hard? Dependencies Databases File systems Web Services Clocks s

Decouple Inject dependencies Replace hard-to-test code with –Fake objects –Mock objects Unit tests should only run your code

Test Driven Development Green Get a green in the easiest way possible. Refactor Clean up the “easy” code and the test. Red Create a very small failing test.

Naming Tests Complete the sentence –Class: SystemUnderTestMethodAShould Test: ReturnFalseGivenInputB Test: ReturnTrueGivenInputC Avoid: –UnitTest1.cs Test1 Test2 –CustomerTests.cs PurchaseTest

Continuous Integration Build solution on a separate machine Build directly from what is in source control Trigger build on every source commit Ensures code in source control can run Ensures code doesn’t just work on your machine

Pairing Involves two minds, not four hands Collaborative effort Quality improves; quantity of non-mundane tasks improves as well Provides immediate feedback –Bugs –Design decisions Constant code review

WHO PAIRS?

Common Concerns “My partner is too slow” –Learn patience –Switch partners frequently –Be a mentor –Learn to type competently (if that’s the issue)

Pair Programming A social skill that takes time and practice Not mentoring, but two developers working together as equals –Of course, working together at a computer is also a great mentoring practice

How Best with co-located teams Best with suitable space and furniture Try to create a team room –Remove walls, cubical furniture –Avoid L- and U-shaped desks

More Bad Layouts

Better Layouts

Ideal Layouts - Tables

Team Rooms

Pair Workstations

When does pairing work best? Complex code Mission-critical code Code that involves design decisions Areas of code everyone should understand

You already do this! When you ask for help with a tricky bug When you run a new design by a teammate When you have someone doublecheck that scary database update script You know it works

When shouldn’t you pair? Mundane tasks Fixing simple typos Spike solutions When distracted –Checking , social media When you’re sick! –Don’t infect others!

When do you switch roles? Every so many minutes After each test is written and passing Whenever one of you gets stuck

Ping Pong Pairing

Alice (Pilot) write a failing test [switch roles] Bob (new Pilot) writes smallest amount of code possible to make test pass Bob refactors if needed (with input from Alice) Bob writes a failing test for the next bit of functionality [switch roles]

Benefits of Pairing Better code Knowledge sharing / transfer More fun Higher productivity / fewer distractions Improved communication Higher truck factor

More Benefits Continual review Improved design Fewer defects Rapid integration of new team members Fewer information silos

Pairing Tips Collaborate and respect one another Set up an effective work area for two Alternate roles frequently Stay engaged and communicate frequently –Think out loud Wait 10 seconds before pointing out every typo –Avoid driving your partner crazy

You’re Doing It Wrong

DISCUSS

Thank you! Brendan brendan.enrick.com Steve ardalis.com