Modelling a unit of your system

Sunshine, zebras and great conversations

Over the last few days I've been in South Africa for Lets Test, held on a fantastic country retreat near Johannesburg. I facilitated a session called a 'Testers Guide to the Illusions of Unit Testing.' I have a confession to make. We had 2 hours to complete the workshop and, in the spirit of having too much content being way better than too little, we didn't get to delve deeply into this question. Hence this blogpost. 

We had great conversations about how unit testing is an interface between testers and developers, a gateway for deep collaboration. This is predicated on an understanding of unit testing, including what they can and can't achieve and what relation they bear to other types of testing. One of the questions we wished to tackle was:
What is a unit of our system?
How many times have you started to test a system and asked "Hey, what are the unit tests like for this unique piece of software history?" The answer in my experience has often been, "um, yeah, about that we don't have any, its too complex/there is no time/its going to deprecated one day." Or alternatively you are involved in a session about the architecture of a brand new system using the latest technologies, using microservices, lambdas or whatever. In either case, wouldn't it be useful to be able to facilitate a discussion about what is a unit of that system and what factors influence it? You might find yourself with a simpler, more observable, controllable and understandable system. Whats not to like?

Reinventing the wheel



The model itself is another wheel. Other shapes are available, although not when I model something apparently. I added a bunch of segments to the wheel that I think impact the size and shape of a unit in a systems context. The key thing here is context, I know that there are definitions of what a unit test is, contested definitions most of the time. What there isn't a definition for what is a unit of YOUR system, the one that YOU work on. Maybe you can use the above to help your team work it out.

There are key areas here, without delving into each one individually:
  • How the code is stored
  • Who contributes to it
  • What architecture and patterns are present
  • How tightly coupled the system is

The segments are also on a scale of size too. As in what factors contribute to a unit being large or small. For example:



  • Large - Single Database for Multiple Applications - this system may have a gigantic database bottleneck, perhaps even changes that one system makes can impact another. That's a weighty unit.
  • Medium - Broker/Queue Based - maybe messages are routed using built in routing configuration capabilities of RabbitMQ? A unit of this system involves invoking (or mocking) multiple systems so could be seen to have largeness too.
  • Small - Microservice(s) - a service that does one thing well - this could be a unit in itself. At the very least, it indicates that units of your system might tend towards smallness.

Explaining with questions

The notes below include questions and examples of each of the sections. They may be useful as further prompts:

### Architectural Patterns
* What type of system architecture is employed?
* How many layers or tiers does it have?
* How many roles do components within have?
* Examples:
 * Three tier
 * Microservices
 * Broker/queue based
 * Model-view-controller 

 
### Coding Practices
* How do contributors collaborate over code?
* What design patterns are employed with the code?
* To what extent does testing drive the coding process?
* Examples:
 * Driving Development with Tests
 * Pairing
 * Code reviews
 * SOLID principles
 * Inheritance
 * Abstraction 

### Concurrent Teams 
* How many teams contribute concurrently to the repository?
* Are they internal or external teams?
* Which teams are core maintainers?
* Examples:
 * Internal development teams
 * Outsourced development teams
 * Contributors to key libraries 

### Source Control Strategy
* What strategy does your team employ to manage code?
* What size changes are often checked in?
* How long until changes are integrated with trunk?
* Examples:
 * GitHub Flow
 * GitFlow
 * Trunk based development

### Source Control Repo
* How large is the repository that you have?
* How many linked repositories does it have?
* How does it manage its dependencies?
* Examples:
 * Monolith
 * Monorepo
 * Microlith 

### Size of Objects/Data 
* What are the key data items that the code manages?
* What size are the important items?
* What depends on those important items?
* Examples:
 * Core classes instantiated for every interaction
 * Persistence of customer data
 * Transaction and audit histories 

### Risk to Whole
* What dependencies exist within your code?
* Are they any common objects or structures?
* Are there any areas teams fear to touch?
* Examples:
 * Large common classes with multiple roles
 * Old versions of dependencies
 * Hard coding/configuration in the code 
 
### Time Periods Used
* What is the lifespan of objects/data created by your code?
* Are there wide differences in the lifespan of different types of objects used?
* Examples:
 * Long lived daemons
 * Scheduled tasks
 * Asynchronous HTTP requests
 * Cache size and expiry rules

Over to you

Essentially, the wheel and guidance is a prompt to help answer these questions about your own system.

  • What factors help to find a unit of your system? (the segments of the wheel, which can be the ones I added, or if you don't like them I have others)
  • What practices & patterns influence that unit? (your own ways of working and crafting principles)
  • How practices and patterns govern size of a unit? (how the way you build stuff affects your ability to test small units of that stuff)

Conclusion

As with all models, this has some holes in it. Not all layers of the system will have the same size unit for example. What is a unit when you test a React application using Jest for example? What unit is creating snapshot files that creates html testing? An interesting questions plus a new and (welcome) challenge to the orthodoxy of automated/unit testing.

Trying to determine what a unit of your system is, will, at the very least lead to asking some searching questions which may provoke a reaction within your team. Overall smallness is the aim for me. After all, if asking these questions serves to help shrink a unit of your system. I believe that testers can be powerful catalysts in this regard.


Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Great blog article informative I liked it

    We are the best piping design course in Hyderabad, India. Sanjary academy Offers Piping Design Course and Best Piping Design Training Institute in Hyderabad. Piping Design Institute in India Piping Design Engineering.
    best Piping Design Course
    piping design course with placement
    pipe stress analysis course in hyderabad
    piping engineering course in hyderabad
    piping stress analysis course
    best Piping Design institute
    best institute of Piping Design Course in India
    Piping Design Course
    Piping Design Course in India­

    ReplyDelete
  3. In this manner my buddy Wesley Virgin's autobiography begins in this SHOCKING and controversial video.

    Wesley was in the army-and shortly after leaving-he found hidden, "SELF MIND CONTROL" tactics that the government and others used to get everything they want.

    These are the same methods many celebrities (notably those who "became famous out of nothing") and top business people used to become rich and famous.

    You've heard that you use less than 10% of your brain.

    That's because the majority of your BRAINPOWER is UNCONSCIOUS.

    Maybe this thought has even occurred INSIDE OF YOUR own head... as it did in my good friend Wesley Virgin's head 7 years back, while driving a non-registered, garbage bucket of a car with a suspended license and on his debit card.

    "I'm absolutely frustrated with living paycheck to paycheck! Why can't I become successful?"

    You've taken part in those types of conversations, ain't it so?

    Your very own success story is waiting to happen. You just need to take a leap of faith in YOURSELF.

    CLICK HERE TO LEARN WESLEY'S SECRETS

    ReplyDelete
  4. If you are stuck with your marketing assignment then in this case you can opt for our Marketing Assignments. we provide the bestOnline marketing expert.We also provide Sales and Promotion help for students across the globe. for more information contact us +16692714848.

    ReplyDelete
  5. Thanks for sharing, great post!

    Áo khoác Đà Lạt chuyên sỉ và lẻ áo khoác áo khoác nam với giá ưu đãi nhất 2020. Luôn cập nhật mẫu mới chất lượng và dày ấm nhất kể cả với thời tiết lạnh giá các nước có du học sinh và xuất khẩu lao động. Aokhoacdalat.com được đồng hành cùng các bạn!!!!

    ReplyDelete
  6. We are well known mobile app development company in Delhi where mobile app development work is done by satisfactorily.For more details visit us -
    www.immortal-technologies.com

    ReplyDelete
  7. 123.hp.com setup , HP Printer Driver Download by Simply Searching Your HP Printer Model. HP Printer Setup, Install or Download Instantly and Get Started.

    ReplyDelete
  8. Very nice this blog . this blog is very informative.such a great blogging website.

    "woman wine expert in usa
    "

    ReplyDelete
  9. Quickbooks is the advanced accounting software to track and manage business related transactions. This tool has multiple premium features to grow your business. Transfer Quickbooks data to a new pc

    ReplyDelete
  10. "HP Envy Printer Offline' error displayed computer unable to communicate with the printer while trying to print 123.hp.com/envy7855 Printer offline troubleshoot issue.

    ReplyDelete
  11. Thanks for sharing this information.
    CloudBox99 offers you with the best Web Hosting Services in Hyderabadand facilitates enterprises to transform digitally. We keep you covered in terms of all your IT requirements with unmatched expertise and deep domain knowledge.Cloud server providers in Hyderabad

    ReplyDelete
  12. While working on quickbooks you might have came across quickbooks error 15311 ,here we have discussed some of the best ways to fix them quickbooks: how to correct error 15311

    ReplyDelete
  13. Superb blog post! And this blog clearly explain about for useful information. I would Thanks for sharing this wonderful content. Its very useful to us. Keep it up!
    php programming interview questions
    php interview questions and answers pdf
    php and mysql interview questions

    ReplyDelete
  14. excellent article
    www.eduanalytix.com

    ReplyDelete
  15. I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post Twitter Influencer Marketing

    ReplyDelete
  16. Best Python Online Training
    What will you bring home from this Python Online course? From ShapeMySkills.pvt .ltd you will begin your vocation as Python; Build a solid establishment in Python Best Python Online Training Institute: ShapeMySkills is the best Python Training Institute in Delhi and Noida giving Online or Offline Python Training classes by real-time.

    https://shapemyskills.in/courses/best-python-training-in-noida/

    ReplyDelete
  17. If Check the two finishes of the USB link are solidly embedded. Assuming the printer offline fix is arranged then ensure the Ethernet link is immovably embedded. If that the printer is remote actually take a look at your web association or ensure it's associated with your switch.

    ReplyDelete
  18. Emblix Academy – Digital marketing institute in KPHB, we address all major and minor aspects required for any student’s advancement in digital marketing. Clutch USA named our Digital Marketing Institute the best SEO firm.

    The future of digital marketing is promising and full of possibilities.

    As a result, skilled digital marketers who can keep up with the rising demand are in high order.
    In the Emblix Academy Digital marketing institute in KPHB, you will learn about all the major and minor modules of digital marketing, from Search engine marketing to Social Media Marketing and almost all Tools used for Digital Marketing.
    One stop place for all Digital Marketing courses! Emblix Academy is a Team of dedicated Professionals with 12years of experience in various Digital Platforms. We assure to provide the best Digital Marketing courses to enhance your Career.
    Certifications

    • Search Advertising
    • Display Advertising
    • Analytics Certification
    • Hubspot Certification
    • Bing Certification
    • Twitter Certification
    • Facebook Certification

    https://emblixacademy.com/

    ReplyDelete

  19. Studying architecture opens numerous opportunities for your career in future. Apart from faring well in examinations, you also have to do well in computer architecture assignment help as it holds a separate scoring system. To grab the grades you deserve, you can call GreatAssignmentHelp for Software Architecture assignment help.

    ReplyDelete
  20. Set up the issue printer such that it prints directly to the printer: After select Settings from the Start menu, click Printers. Click Properties from the menu bar when you right-click the issue printer. Select the Details tab, then select Spool Settings, Print to printer directly, and OK. Visit our website to learn more about the HP Printer Access Denied Issue.

    ReplyDelete
  21. Fantastic article You provided some excellent information in this article, and I will also share it. Using a fake Twitter profile generator tool, you can establish a new fake Twitter account and gain more followers on Twitter. To find out more details, read this article create fake twitter account.

    ReplyDelete
  22. That's a pretty cool way to test a unit. This type of test will give us a granular view of how our codes are performing. Website developers should take careful note of this informative article. Well done! Web Design Dubai

    ReplyDelete
  23. Most HR associations (HROs) let enormous organizations single out which HR administrations they need to re-appropriate. A co-administration association or shared HR relationship is made between the HRO and the business when simply a part of the capabilities are taken care of by the HRO (this is regularly the moderate way to deal with that initially rethinking HR). At the point when all HR center capabilities are contracted out, the HRO is in control completely. The essential HR the executives capabilities are still inside held in enormous firms, while most of managerial and strategic jobs are reevaluated>> the functions of human resource management

    ReplyDelete
  24. That's quite considerable. Thanks for letting us know about this effective way to test a unit. flower shop dubai

    ReplyDelete


  25. Amazing content. I saved it to my bookmarks to refer to in the future.
    nearest mobile repair shop

    ReplyDelete

  26. Hey, you have a great blog. I'll bookmark it and plan to return it often.
    washing machine repair sharjah al taawun

    ReplyDelete
  27. I'm so eating up this stuff is pondering the web, and your post really convinced me. You should get the bearing you gave at home. Perhaps the visitor presence will be a boggling one.

    microsoft surface repair dubai
    microsoft surface repair dubai


    ReplyDelete
  28. Immerse yourself in the healing light of Healing Buddha, where individuals find solace, rejuvenation, and a renewed zest for life through the power of energy healing.
    healingbuddha

    ReplyDelete
  29. Amazing Post! BookMyEssay chicago format citation generatorr simplifies accurate referencing. Automatically generate citations for various sources in Chicago style, saving time and ensuring proper academic citations.

    ReplyDelete
  30. Developers can create test cases for all functions and methods, isolate functions to test them more thoroughly, and utilize Unit Test frameworks to create automated test cases for unit testing to assist a conversation about what constitutes a unit of a system and what influences it. cyber security companies in Saudi Arabia

    ReplyDelete
  31. Among the top providers of IT services, mobile app development, and development is Appgenix Infotech. We offer customized IT services to meet your needs. We have completed numerous projects with excellence. The client cooperated with us and expressed great satisfaction with our service

    ReplyDelete
  32. "Hats off to you! Your blog stands out with its unique and insightful content. It's evident that you pour your passion into every piece. Keep up the great work!"
    cheddar's coupon

    ReplyDelete
  33. "I'm constantly impressed by the diversity of topics you cover on your blog. Whether it's a deep dive into a niche subject or a broader exploration, your writing always hits the mark. Keep up the amazing work!"
    busy baby mat coupons

    ReplyDelete

Post a Comment