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