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:

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