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.

 

Subscribe for Email Updates:

Categories:

Tags:

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

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