5 steps to get unit tests going

Facebook
Twitter
LinkedIn
Pinterest
WhatsApp

Once you start unit testing, you will find significant benefits to your design, throughput, quality, and peace of mind. However, it is not easy to start in an organization that’s not used to it. Here are a number of practical tips:

First step: Make sure the motivation is there – as you will see down the list, this change (like most changes) will require the organization to invest time and work in it. Understand the current situation, understand the pains, get some statistics. There will usually be someone who tried writing unit tests – talk with them, try to understand the challenges. Have a kickoff meeting with the team, understand together why are you doing this and how will the process look like. Have a kickoff with management, you will definitely need their support, you need to be on the same page. Whenever it gets tough (it will), get back to this discussion.

Second step: Train the team – I think training should be minimal – just enough so people will understand what they’re going into. Most of the learning is on the job. I do one day training in which I teach the basics of unit tests in the specific technology (I had lately the opportunity of working with an organization in which I taught c# with visual studio tests, react/native with jest + testing library, angularjs with jest and java with junit). We do some TDD with mob programming and finish with unit tests on legacy code techniques.

At this point some people (highly motivated) may start experimenting. Help them.

Third step: Open roads in the legacy code – adding tests to legacy code is difficult at the beginning. Pair with motivated individuals to crack it up, and find patterns to use on their legacy code (see my video about this: English / Hebrew). Sometimes you’ll need utilities, sometimes you’ll need to do some refactoring to allow people to start work.

Are people starting to write tests? Sometimes they do.

Fourth step: Pair with developers – We had the training, we opened up the roads, and now it is time to start moving the ship. Experience tells me I need to sit with almost all developers and pair with them, writing their first tests. Only when you do that realization seeps in. There are many A-Ha moments, I like it.

You would expect people to start writing unit tests by this time. However, change is very difficult. Remember at the beginning writing the unit test is an additional effort. It returns the investment very fast but it is an additional effort.

Fifth step: Let developers write unit tests without you – this is where, together with the team, we start adding the tests gently into the definition of done. They must do it without you, they must wrestle with the legacy code to get it moving. Like other technological challenges, you need some intensity to grasp them. This is the difficult part.

The first time you change code that already has unit tests is a magical moment. The tests tell you the story in simple words, they guide you and keep you safe. The time and sweat were worth it.

 

Categories:

Tags:

Continuous Deployment
Jira Cloud
Jira Plans
Kaizen Workshop
SAFe Release Planning
SPC
Code
Agile Product Ownership
Atlaassian
RSA
Business Agility
Legacy Code
Scrum Values
Continuous Delivery
Introduction to Test Driven Development
Risk Management in Kanban
Entrepreneurial Operating System®
Product Management
ATDD vs. BDD
LeSS
The Kanban Method
Lean Startup
Agile Exercises
Agile Delivery
Agile Release Planning
Agile Community
Iterative Incremental Development
Kanban
Quality Assurance
Continuous Improvement
Certified SAFe
Jira
Continuous Planning
Agile Project Management
Scrum and XP
SAFe DevOps
An Appreciative Retrospective
Legacy Enterprise
Reading List
Lean Agile Management
Agile Games and Exercises
Lean Budgeting
AgileSparks
Releases Using Lean
Engineering Practices
Test Driven Development
speed @ scale
Sprint Planning
Risk Management on Agile Projects
ROI
Scrum Guide
Acceptance Test-Driven Development
Nexus vs SAFe
Artificial Intelligence
Elastic Leadership
Systems Thinking
Agile
Agile Project
Coaching Agile Teams
Product Ownership
Lean Risk Management
Nexus and SAFe
Scaled Agile Framework
Agile Techniques
AI Artificial Intelligence
Tips
Agile India
Lean Agile Basics
Scrum Primer
Large Scale Scrum
Value Streams
Kanban 101
Video
Self-organization
Agile Release Management
Program Increment
ARTs
Agile Contracts Best Practices
Pomodoro Technique
Story Slicing
Development Value Streams
Professional Scrum Product Owner
Managing Risk on Agile Projects
SA
Scrum
Process Improvement
Daily Scrum
Kanban Kickstart Example
Agile Assembly Architecture
RTE
Scrum With Kanban
ALM Tools
Release Train Engineer
Achieve Business Agility
WIP
DevOps
LAB
Lean Agile
Sprint Retrospectives
ATDD
Implementation of Lean and Agile
Kanban Game
A Kanban System for Software Engineering
Enterprise DevOps
Presentation
Agile Program
Agile and DevOps Journey
PI Objectives
Applying Agile Methodology
Nexus Integration Team
Agile in the Enterprise
Accelerate Value Delivery At Scale
Scrum Master
Certification
Planning
Rapid RTC
Amdocs
Lean-Agile Budgeting
Limiting Work in Progress
Software Development
speed at scale
Effective Agile Retrospectives
EOS®
Nexus
Covid19
Risk-aware Product Development
Agility
POPM
Kanban Basics
Lean Software Development
Agile Testing Practices
Advanced Roadmaps
Change Management
Slides
Portfolio for Jira
Agile Games
Agile Marketing
QA
System Team
Scrum Master Role
NIT
ART Success
Lean and Agile Techniques
IT Operations
Agile Risk Management
Continuous Integration
Lean and Agile Principles and Practices
Games and Exercises
Agile Product Development
Scrum.org
PI Planning
Frameworks
Agile Basics
System Integration Environments
Agile Outsourcing
Lean Agile Leadership
Software Development Estimation
lean agile change management
TDD
Nexus and Kanban
LPM
Built-In Quality
Implementing SAFe
BDD
Managing Projects
Hybrid Work
ScrumMaster Tales
Operational Value Stream
Agile Mindset
Kaizen
GanttBan
What Is Kanban
SAFe
Perfection Game
Sprint Iteration
Manage Budget Creation
Lean-Agile Software Development
Lean Agile Organization
Spotify
Principles of Lean-Agile Leadership
Agile Israel Events
Agile Development
System Archetypes
Professional Scrum Master
Webinar
The Agile Coach
Agile for Embedded Systems
Introduction to ATDD
Professional Scrum with Kanban
AgileSparks
Logo

Contact Us

Request for additional information and prices

AgileSparks Newsletter

Subscribe to our newsletter, and stay updated on the latest Agile news and events

This website uses Cookies to provide a better experience
Shopping cart