Business Review: The Gateway to Automation

Automation is a must. Not only because it's the main principle for REAL DevOps but also because is the only way to work properly on the Cloud. As you move your workloads to the cloud, you will learn you will need to change your mindsets too. Automation is something everybody talks about at the end of the day people dont create 100% automation overnight. Often people dont know what to automate and that a problem with often is not tackle by teams. Today I want to share a kanban practice that I do since 2009 and hope this help your team to increase automation. This practice is called business review.  Most modern teams dont have QA anymore and engineers are responsible for creating their own tests, however often as engineers, we could get sloppy and forget to do proper testing and this sloppiness has a price of bugs created by the lack of tests. Business Review is a peer review process where engineers review their peers work, similar to the Code Review but looking to different things.
 Why Code Review is Not Enough? 

Code Review is great, dont get me wrong. However, is not enough. Often code review focus on the technical quality.  Concerns such as the following are evaluated: 
  • Is the Design correct?
  • Is the performance acceptable? 
  • Are we using the best algorithms and Data Structures?
  • Are we doing any kind of danger coding? throw exceptions? null return? 
  • Are all validations in place?
  • Are the tests in place? Unit? Integration? Mocked? Stress? Chaos? 
IMHO We should not focus in style for code review. Because style is pointless. Clean Code often makes you focus on the wrong things like should I use a for streams in java for instance. Changing for to Streams is a waste of time, not mention is slow. So if code reviews get all these great things to mention before, why this is not enough? Because we are missing Business. Therefore we are missing automation. However this review cannot be done only looking to the source code, we need to do more stuff. 

The Principles Behind Business Review

First of all. Does the UI works? do we see any bad CSS or ugly thing? Secondly is the i18n right? If all is good. Them some clicks won't kill anyone. These clicks are called exploratory tests.  Exploratory tests are important, you dont need to spend an hour doing clicks and testing things but for sure a couple of minutes won't kill anyone. Your findings might also reduce bugs but more important REVEAL automation points that might be missing like: 
   A) Do we have proper CI/CD/GitOps pipeline in place?
   B) Is the test coverage good? 
   C) Are we missing an error or failure scenarios? 

Business Review also serves for you to check the contract TESTS to see if any API was broken. That could be for the backend or even for the frontend.  After a couple of cycles, you should get nothing more on the business review. If you are not adding more tests and increasing your automation the business review loses his point. Because if you dont increase automation you are just doing manual QA and manual QA dont scale and is super expensive. Remember the point is to have a gateway drug to automation. Business Review is best captured by a kanban queue and all engineers should do BR(Business Review) in regular rotations. 

Increasing Parallelism with Mock Contract Tests

Frontend always will depend on the backend. However, is not cool to let the frontend guys waiting to engineer something if the backend is not done. Because this will increase LEAD TIME and we want to the other way around and reduce LEAD TIME. In order to do that we need to have the contract of the APIs defined by the discovery TEAM(Architect + UX + BA)  and the developers must receive the contract defined by the discovery. Having the contract the frontend and backend can work in parallel and this will reduce the waiting time. 

Greater parallelism has a price. You will see more merges, which is completely fine. Also, you will need additional story to unplug the mocks at some point and test the system as a whole. During the process, you might create E2E or Integration Tests. Integration Tests are great but they should be a very small percentage of your tests, you should have way more unit tests them integration ones. 

The issue with integration tests is that they are SLOW and they depend on Data and easily you might lose this data or get outdated and this is WASTE for the developer.  But hold on a second, as we do the thing in parallel how do we know we dont break each other, well there are 2 actions we can take to make sure that does not happen. First, the contracts(best defined in Swagger nowadays) come from the discovery and the developers cannot change the contract without talking with the discovery team. Second, instead of doing lots of integration testes we do MOCK CONTRACT tests.  These tests can be done with regular mocking tools and uni testing tools, for instance in java could be JUnit + Mockito. Contract tests should be versioned and they must be lightweight so developers can run all the time and this will make sure we are not breaking each other(frontend and backend). 

As the time pass and you gain more traction is fine to remove the business review queue from kanban at some point. In the beginning, is very important to have this queue with very explicit queue policies in order to have developer aware what they need to do like: click on the ui, do exploratory tests, check the internationalization, run all testes, check the deb scripts and so on and on. 

Cheers,
Diego Pacheco

Popular posts from this blog

C Unit Testing with Check

Having fun with Zig Language

HMAC in Java