Unit tests, programmers, and testers

These days I am participating, as a Peer Advisor, at the Online Rapid Software Testing Explored class with James Bach. 

I had an interesting experience that made me think and articulate more carefully about a certain subject. I say this because although we might know we have the answer to some questions we usually see just a part of a situation and sometimes we might forget (not consider) more clearly the context(s) for which the answer might apply. But there is more. Is about the context(s) of the one who poses the question, the context(s) of the ones who might participate in the conversation and the context(s) that influenced my answer. 

The example described below helped me realize this and adapt my message.

At a certain moment, the topic of testers and unit checks[tests] and whether testers should be involved or do them, popped up. I gave a response. Afterwards somebody in the class thought that I was saying that testers should never touch the product on a unit level.  Then another student in the class asked if a tester could do pair programming with a programmer, when the programmer was doing the unit checks[tests].

I am glad that those two students stepped in and made me aware of their contexts. 

At that moment I realized that my message was not accompanied with all the premises I had in my head and the realities that affected my response.

I say premises because of a blog post, written by Michael Bolton, where he says that: “Most arguments seem to be about conclusions, when they’re really about premises” (1)

So here are premises that I had in my mind:

  • unit checking[testing] with mutation checking[testing] AND TDD are techniques that the programmer uses to take care of the semantic stability of the code. (2)
  • it is helpful for testers to have interactional expertise, as Harry Collins intends it, when it is about code. Allways a session of pair programming or a code review done with a tester is something that is special. Special in the sense that the programmer feels very well that is something else. Is like the tester without wanting it, it triggers some tacit aspects in programmers mind regarding code, that usually with another programmer does not necessarily happen.
  • me witnessing and discussing with testers, often, that they are being forced to do unit tests[checks] and selenium via UI. Testers which have no programming background and for which the message is that if they don’t do these, they are out.
  • for me testing is this one that James Bach is teaching, the RST (more broadly I am thinking about Context Driven Testing where we have the RST, BBST, JIT, Buccaneer Testing)
  • I have been a programmer for 19 years already. It was hard, but at this point I can say that I no longer make any confusion between testing and checking (3). And also, I am very aware of how management might misuse, abuse, play these disciplines, not in a naturalistic way of how things should fit, if may I say so.
  • I deeply appreciate and encourage when both programmers and testers try to find out about each other’s nature of work. And I say this because of several reasons: empathy, helping in sensing and navigating the complexity of the product needed to be done, helping with test ideas the tester.
  • context is everything, I have no doubt. And when I say this, I am fully aware about the cognitive patterns activations which are triggered by the situational context. (4)
  • knowing the origin of a theory, principle, … is good because when making deviations from it, we will know why it might work or not work. For example, we have been doing at industry level OOP wrong, I believe, for the past 40 years now (5). We have just taken some principles/techniques out and popularized them without understanding the whole thing as it should be, and we wonder why it does not work.
  • the importance of identity/role and how in the IT industry we try to smash these and use in reckless ways just some techniques.
  • testing is an intellectual discipline because in RST we say that testing is applied epistemology.
  • a tester is or should be closer to the people using, in the end, the application.

So, should a tester do TDD or unit checks[tests]? And I realized that it depends also on what it means by ‘do’. Does ‘do’ mean:

  • being forced by a polluted context where the real testing has no chance of being done and the tester otherwise might get fired.
  • because the tester wants to learn what it means for a programmer to do it.
  • because the tester wants to learn programming in this way.
  • because the tester thinks it’s his/her responsibility.
  • because the tester is also a programmer and switching context might be needed (Side note: Very often I find myself in this situation. But I am fully aware about the programming and testing disciplines and their particularities, intentions, goals…).
  • because the tester wants to help, she/he loves so much the context that will do whatever it takes to help.

I have answered initially in the class by considering just one interpretation of ‘do’. Mea maxima culpa. But I did it because I am deeply affected by the realities I am witnessing. Realities which try to reduce testing from a discipline to just some techniques which can be fully automated, if I may say so. And as a programmer I know that I need a complement that will not confirm and follow my biases but will really complement my actions/work/ideas.


(1) Testing, Checking, and Changing the Language. James Bach, Michael Bolton. http://www.developsense.com/blog/2009/09/testing-checking-and-changing-language/

(2) Robert C. Martin. https://cleancoders.com/

(3) Testing and Checking Refined. James Bach, Michael Bolton.   https://www.satisfice.com/blog/archives/856

(4)  The Context–Object–Manipulation Triad: Cross Talk during Action Perception Revealed by fMRI. Journal of Cognitive Neuroscience. Wurm, M., Cramon, D., & Schubotz, R. (2012), 24, 1548-1559. https://doi.org/10.1162/jocn_a_00232 

Implicitly activated memories are associated to general context cues. Memory & Cognition. Nelson, D., Goodmon, L., & Akirmak, U. (2007), 35, 1878-1891. https://doi.org/10.3758/BF03192922 

(5) When I think about OOP, I have in my mind the work of Trygve Reenskaug and James Coplien regarding OOP: https://fulloo.info/

About microservices and software architecture

This topic of microservices continues to pop-up in my professional activity. 

I remember that some time ago, I heard James Coplien say in a video something like “Microservices…don’t let me start with this”. I wanted to decipher this. Because of that, I re-read his wonderful software architecture book(1) and all of his OOP materials (2).

Small note: I tried to find again the initial video and no luck. Still the words remained in my head. After James reply I realized that I was not off track with my memory.

I have to say from the beginning that this trend regarding microservices is becoming rather dangerous (maybe because of wrong focus or  because of misunderstanding of what software architecture really is or because it is not known what OOP actually is or …). I usually say to my friends, colleagues the nightmare we will have in 10 years or so when we will have to maintain the so-called microservices approaches.

What James Coplien said in that video and how he said it hunted me. Then, suddenly, I have found a way to decipher/decompress what he said when I read the paper “The DCI Paradigm: Taking Object Orientation Into the Architecture World”(3). Below are fragments from the article which triggered my thoughts/perceptions/insights:

● “…The authors have been working on a paradigm called DCI(Data, Context and Interaction) that places the human experiences of design and use of programs equally at centre stage…” ➜ Is hard to do that with microservices, they are not about humans at all. The way the subject of microservices is put on the scene is not about human experience at all.

● “…Architecture is the form of any system created through conscious design, and it thus has strong human elements both in its process and its product.The term form implies a deep mental model of the essence of some Structure…” ➜ With microservices it is hard for me to see the holistic form of the system, that’s why I can’t see microservices as architecture. For me is about some low level technical details and about deployments. 

●“…Form is the deep essence of what is common between these systems, just as Victorian architecture is the essence of common elements across innumerable houses…” ➜ Here is mentioned the Victorian style, but I thought of the Romanian style named Brâncovenesc(4). James and Trygve are right. When I look at the houses, churches I can say that it is about the Brancovenesc style and I can see that it is different from Victorian style. So, when I look at an HR application or Planning events application I should see that form which speaks about that kind of application. And the fact of what iron or cement was used is another story. I think with microservices it is hard to see the forest from the trees.

●“…Why do we do architecture?It might be useful to revisit some of the key goals of architecture. As mentioned above, Vitruvius reduces the purpose of architecture to utilitas(commodity or utility), firmitas (firmness) and venustas (delight). These goals echo strongly in software, which has adopted them with its own emphases. More broadly, architecture is, and always has been about form. Except among specialists, the English word form is often confounded with structure, and software folks in particular often incorrectly infer that a system’s architecture is the structure of its artefact. The proper architectural usage of the term form has historically been more precise. It’s important to differentiate form from structure: Form is the essence of structure. We can talk in detail about the form of gothic cathedrals even without having a gothic cathedral at hand. Form is the conceptualization of structure in terms of the relationship between parts, and between the parts and their environment. Many given structures can implement a given form, just as there are many (different) gothic cathedrals, all of which implement the forms of gothic cathedrals…” ➜ So, maybe, microservices came with a “structural” flavor and also a simple mechanism of sending/receiving data.

●“…SOA defined services, but at a level that was usually far removed from the code; it is probably a better metaphor for urban planning than for the architecture of a house…” ➜ Yes indeed, this SOA stuff was at the far extremity of the code, just a simple entry point in the system, but nothing else. I was amazed to see whole books regarding how to explain these endpoints and how the entire code structure has been influenced and is not ok. 

● “…This may well be because great architectural talent arises from domain knowledge, and it’s difficult to treat architecture as a generic discipline within the (generic) discipline of programming. In the end, architecture has arisen as a generic discipline of tools rather than the result of a quest for beauty and utility…” ➜ The knowing of the domain and its importance is diminished because all the discussions focus on the hammer, scaffold,..

I asked James Coplien to help me out. I really needed his help. He was very kind to review and give me feedback about my insights:<< “Yes” to all of your insights. The main one that bothers me is the lack of a coherent system overview. All understanding is local and the system behavior is taken to be emergent. That doesn’t work except at incredibly large levels of scale and scope.>>(5)

After his feedback I had the pleasure and honor to meet him in person, in Athens. I had participated in 3 of his wonderful trainings about Scrum – a blog post will soon come about this. I hope that soon I will also participate at his DCI training. I am waiting for this DCI training for a very very long time – sometimes I feel this is an impossible dream. Actually, one important reason I decided to have the Scrum trainings with him was the hope to have some minutes with him to discuss about architecture and OOP and it worth it.


(1) James O. Coplien, Gertrud Bjørnvig, “Lean Architecture: for Agile Software Development, https://www.amazon.com/Lean-Architecture-Agile-Software-Development/dp/0470684208/ 

(2) James O. Coplien, “Publications”, https://sites.google.com/a/gertrudandcope.com/info/Publications

(3) James O. Coplien, Trygve Reenskaug, “The DCI Paradigm: Taking Object Orientation into the Architecture World”, https://doi.org/10.1016/B978-0-12-407772-0.00002-2

(4) “Brâncovenesc style”, https://en.wikipedia.org/wiki/Br%C3%A2ncovenesc_style 

(5) Text used with permission (March, October 2019)

The hidden dimensions of code review(s) – part 2

Some dimensions will be treated in this blog post and on part 3 of this blog posts series(see part 1 here) , my friend, Ionut Albescu will help out with the dimensions and sub-dimensions which were left out. 

The dimensions

Programming(Design, Clean Code, Refactoring, Unit Checking) 

There are a lot of materials covering these aspects. Just search for books by James Coplien, Robert C. Martin, Martin Fowler, Michael Feathers and you will get an idea of each of these topics. Usually, in appearance, this is the dimension were code review is concentrated. I said in appearance because these topics cannot be mastered in a month or two, not at all. But is more, although management/customers/end users will expect programmers to excel in this… well is not quite like this… 

Programming – Impact

This sub-dimension is to make the programmer aware of how the functionality she/he implemented will impact the final user. How many programmers think that because of their work an end user can be fired? 

Testing

Here I am thinking about Context Driven Testing(1) school of thought, especially Rapid Software Testing(2). This testing has its roots in cognitive psychology and epistemology(3). Please read the work of James Bach, Michael Bolton, Cem Kaner, Jerry Weinberg. 

If you are a developer and want to ignore this dimension than I advise you to think better. You will lose the chance to be an even better professional. 

Testing – History

James Bach, some time ago, pointed me out about the book “Your Code as a Crime Scene: Use Forensic Techniques to Arrest Defects, Bottlenecks, and Bad Design in Your Programs”. I was thrilled to see how many things can be deduced just by looking in the source control history. I was able to see the weak points of code and where to concentrate the refactoring. It was there in front of my eyes the Paretto principle, helping me in prioritizing work, but also helping testers in guiding their test strategy.

Testing – Testability of the application 

We need to give the application control points so the testers, programmers can exercise more easily certain scenarios. For example replacing more easily components. If we can’t do this, then is a red flag. 

Testing – Risks

4 sub-dimensions listed here are from the wonderful paper “Risks Analysis Heuristics (for Digital Products)”(4): project factors, technology factors, specification factors, operational factors. Studying this paper made me realize that coding is not just about if, else, while… instructions. 

The tester(s) have a different mindset, which should be viewed as a complementary to the one we already have, as a developer. Developers look at the code with the assumption that is right, but we need testers to look at the code with the assumption that is wrong(they are negative, they focus on failure(3)).

Business

All the code should be driven by the business need. Use cases/activities should drive the code and it’s structure. How do you know that a duplication is not just a temporary one which in the end will no longer exist? How do you know that you are applying ok the Single Responsibility Principle? Well guided by the business, the actors. 

Business – Analysis

I remember we discussed the heuristic “Mary had a little  lamb”(5). This heuristic help identify ambiguity statements which are in written form. The secret is to concentrate on each word one by one and then in combinations.  Let’s take the word “Mary”. We concentrate on this word by posing questions: Why Mary? Why not Giovanni? Let’s take the word “had” from the sentence: Why it had? What happened that no longer has it? What about present, future? Will it have another one in the future?. 

I love this technique. A lot of programmers want and  expect fully written requirements without side effects. But is not possible because:

–  it is a lot of tacit knowledge;

– is one thing for people to see the data(let’s not forget that even with the highest concentration we partially see/scan stuff), one is to pay attention to it and a different thing to act upon that data. (6)

Most of the time we go on the supposition that we know what customers/end users want. But is it like that? What if the end user does not know? What if the end user is unaware of certain things, on which we might help, which are possible and they may want it?  Why to code a thing and put a lot of effort in abstractions, algorithms when … maybe … that is not the path to follow? 

Is time for a lot of programmers to grow up and not ask for things just because it will be easier for them. Or search for excuses not to do work. They will code certain business things. This means they are directly responsible to understand and make sure they understand those business things. Christopher Alexander put it very nicely: “Please  forgive me, I’m going  to be very direct and  blunt for a horrible second. It  could be thought that the technical  way in which you currently look at programming is almost as  if you were willing to be ‘guns for hire.’In other words, you  are the technicians. You know how to make the programs work.‘Tell us what to do,Daddy, and  we’ll do it.’That is the worm in the apple.”(7)

Business – Impact 

Here is about building products and delivering projects that make an impact, not just ship software.

There is a technique for doing this which is called Impact Mapping(8). 

Impact mapping is a planning technique which uses in a very inspired way guiding mind maps in helping achieve this by guiding/facilitating the process. It shifts the focus from just doing what the customer orders to  focus on collaborating with all involved parties. The goal of the impact maps focuses on the question “Why are we doing this?” and gives a strong guidance on how to do this. This work collaboration between senior technical and business people is a must because the code changes based on this interaction. The abstractions, objects, architecture is strongly influenced by this. The business must be known by senior programmer – is a sine qua non condition for the seniority of the programmer. 

Business – Demo

At the end people will see the result of the code, not the code itself. This result is the desired effect. This means that the end user, the Product Owner have to see it and the programmer to get an early feedback. So this aspect can help the developer to be ok/prepared when doing the Demo. 

UX

Most often the work of the programmers is reflected in the UI. The final user does not see what is underneath. I really like how James Coplien makes the connection between object oriented programming and UX.  Is normal because via UX we try to translate as much as we can the mental model of the user and then that mental model must be reflected in code.

Human

Very often we forget the social aspect of programming. We do not realize that architecture, for example, has a social aspect. This is very important. 

Is not easy to integrate and make work two or more, different, personalities. I wrote before about this. There can be a conflict, a political stuff, sadness, ….All this can affect and will affect the quality of the code review.

In the mind map we put the word “Affinity” to be aware of all the subjectivity that can be present.

We put the word “Experience” because:

– of seeing bad examples. People who were considered seniors but they were affecting in a bad way how the review was done. Also the other team members, the juniors one, were influenced by these “seniors”;

– the experience plays a role in review because of the learning that can be done. Having an experienced developer that can share knowledge hands on;

– people with no programing experience , like some testers, were posing interesting questions. And the explanation towards them had to change a little bit;

About inattentional blindness, I wrote before about this aspect and code reviews.

Partial Conclusion

– Trygve Reenskaug had an interesting idea: the reviewer having the responsibility of the code being reviewed, not the programmer who wrote it. That for sure will change the dynamic of code reviews and it can make code review(s) more valuable/interesting not just a monoton approve step(9);

– After we (Alexandra Vasile, Marius Jantea, Ionuț Albescu and I) created the mind map and thought together at those dimensions and explanations I realized that in my subconsciousness I might have been influenced by the wonderful book named “Handbook of Technical Reviews” written by Jerry Weinberg(10);

– Seeing how code reviews are being done/treated gave me a clue regarding the dynamic of the team and possible sociological/management/organizational problems that might be there. I say this because a characteristic of complex systems is fractality;

– Do you feel to modify the mind map, to add more dimensions and sub-dimensions? Good;

On Part 3 of this blog post my friend Ionuț Albescu will continue in clarifying the other dimensions which were left out and also will give his personal touch on this subject of code reviews. 


(1) Context Driven Testing, http://context-driven-testing.com/ 

(2) Rapid Software Testing Methodology, https://www.satisfice.com/rapid-testing-methodology 

(3) James Bach, “Lessons Learned in Software Testing: A Context-Driven Approach”, https://www.amazon.com/Lessons-Learned-Software-Testing-Context-Driven/dp/0471081124# 

(4) James Bach, Michael Bolton, “Risks Analysis Heuristics (for Digital Products)”, http://www.developsense.com/resources/RiskHeuristics.pdf

(5) Jerry Weinberg, “Exploring Requirements” https://leanpub.com/b/requirements#bundle-page-exploringrequirementsone 

(6) Dave Snowden, “See-Attend-Act”, https://cognitive-edge.com/blog/see-attend-act1/ 

(7) Christopher Alexander, “The Origins of Pattern Theory: The Future of the Theory, and the Generation of a Living World”, https://pdfs.semanticscholar.org/7157/ee5a77c6fd64f8b8b2282225f113205370e9.pdf

(8) Gojko Adzic, “Impact mapping”, https://leanpub.com/impact-mapping 

(9) Trygve Reenskaug, “DCI: Re-thinking the foundations of object orientation and of programming”, https://vimeo.com/8235394

(10) Jerry Weinberg, “Handbook of Technical Reviews”, https://leanpub.com/handbookoftechnicalreviewsfourthedition 

The hidden dimensions of code review(s) – part 1

Context

The title image was created last year in December with the help of three friends (Alexandra Vasile, Marius Jantea and Ionuț Albescu) over lunch. Since then, I try to write about this subject. The trigger point was when, again, I saw a collocated team using exclusively a tool for code reviews and no personal discussion. It was clear to me that I was seeing some effects of bad things that happened there before and people were hiding themselves behind tools – is so easy to do this.

When I asked them why they did it in this way, they had a perfect excuse: audit. Smart things can be done so that an audit will not generate stupid behaviors. I saw that in our industry, at least here in my area, this audit is a good excuse for bad behaviors/recipes. I think there is a gross misinterpretation of the audit intention and on what should be done. 

So in this case, as in many others, it was about abnormal/bad work environment, lack of understanding subjects/topics  involving our day to day work(audits, code review(s), testing,… ). 

The good thing is that it forced me to think very seriously on code reviews and what it meant for my friends and I. I have to say that when  discussing with my friends, I had in mind the way how James Bach and Michael Bolton analyses certain things(1). 

Why is so important

I continuously saw how this subject, in my opinion, was badly treated. But why it irritated me so much? Well, among other things, because:

– this is how I learned a lot of programming stuff;

– it is so obvious the connection with testing and how helpful is to find bugs;

-it helped me see the connection with the idea of complexity(those things which are named boundaries and how the system will adapt/shape/modelate based on those) (2) ;

– the serious analysis which is being(should be) done can help us arrive at profound stuff;

Checklists

There was a time in my professional life when it was enough to say the words “checklist” and “tool”, when a problem popped out, and everything would have been OK in the eyes of certain managers. I think that those managers wanted simplicity, but most often we deal with an essential complexity. Somehow I felt that, for those managers, the situation awareness always could have been reduced to some simple/obvious things in a very fast way. Everything was reduced to recipes.

Context is everything. This means situations can have different dynamic. I am afraid that for those managers all the situations were all simple/obvious( in Cynefin terms)(3). So for them it was assuring that having that checklist would have acted as a guard with, almost, ad litteram actions described in that checklist – and it makes sense for the Obvious domain in Cynefin, but we are not always there, not at all. 

What if a checklist in complex domain, or liminal zone between complex and complicated, has a different form/significance? What if it means something else? I think that at this level we speak about compressed knowledge, cognitive activations, heuristics. They can’t be used ad litteram, is a lot of uncertainty. I understood this when I had the Rapid Software Testing course with James Bach. James had a list of  different words regarding testing on a slide, it was a huge slide full with words. Someone could have transformed that list in a checklist but…not ok. Each word from there could have been described in a lot of text and lots of actions dependent on context. 

This is how I realized that a professional expert might use a checklist in a different way than a junior would use it.

Maybe also with checklists, in these kind of contexts, the secret is … checklists “all the way down”(4) – and this is a whole different story, for sure not a simple one. James Bach said it so nicely: “Heuristics are often presented as a checklist of open-ended questions, suggestions, or guidewords. A heuristic checklist is not the same as a checklist of actions such as you might include as “steps to reproduce” in a bug report. It’s purpose is not to control your actions, but help you consider more possibilities and interesting aspects of the problem.”(5)

So, to come back to checklists as we know them which are used, most often as I saw it, for process compliance, just tick in the box – which for certain people, not professional who play good politics, can use to cover their ass :(. 

Pull requests

Instead of hearing the words “code review”, I often hear the words “pull request”. And of course the link of that “pull request” was sent by chat to the collocated colleagues. I would like to say that this is something new for me, but it is not. But what is even stranger, is those collocated people decide to do exclusively the code review via the tool. This reminds me of the team who was doing daily meetings via Skype although they were in the same office… 

I know there can be good scenarios to make code review via the tool. But to have it exclusively, no matter what, via the tool for collocated colleagues is rather problematic.  

The justification for pull request(s) most often is, again, the audit.

Why dimensions

I noticed that code review has only a narrow perspective in the eyes/actions of many people. Some aspects, intentionally or unintentionally, are not considered, like: the environment, the context of where that code lives, what generated that code, the possible unintended consequences of the code,… 

Is not enough to concentrate on those lines of code only. I say this because of 2 reasons:

– if something is not seen/observed does not mean it does not exist.

– I think that code has a complex aspect in it. This means that we have to see the connections also. Because in complexity is all about connections. 

The title image from this blog post was created to show the possible dimensions worth considering, at a certain moment, when doing a code review. It is a guideline.

Depending on the moment when code review is being done, certain dimensions(see the image below)  can be ignored while others will matter more. For example, in the image below, I want to concentrate on seeing how SOLID(6) principles were applied guided by the business need:

In the part 2 and part 3 of this series we (Ionut Albescu and I) will tackle these dimensions. 


(1) James Bach, Michael Bolton, ”A Transpection Session: Inputs and Expected Results”,  https://www.developsense.com/blog/2010/05/a-transpection-session-inputs-and-expected-results/ 

(2) Dave Snowden, “Boundaries”, https://cognitive-edge.com/blog/boundaries/  

(3) Dave Snowden, “Cynefin Framework Introduction”, https://cognitive-edge.com/videos/cynefin-framework-introduction/ 

(4)”Turtles all the way down – is an expression of the problem of infinite regress” , https://en.m.wikipedia.org/wiki/Turtles_all_the_way_down 

(5) James Bach, “Heuristic Risk-Based Testing”, http://www.testingeducation.org/course_notes/bach_james/cm_2002_rapidsoftwaretesting/rapidsoftwaretesting_13_heuristic_risk_based_testing.pdf 

(6) Robert C. Martin, “The Principles of OOD”, http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod 

How testers can provide value for developers

On the Rapid Software Testing slack Channel(1), one month ago, an interesting  question was put by David Högberg:

Here is an interesting story and question from my friend in another Slack-group:

(translated from Swedish)

”Today was the last day of a sprint in one of the teams I coach at….

A backend developer has been very productive this sprint, he has pulled in more tickets than planned and finished those. Instead of pulling in another ticket on the last day he took the initiative to work on the unit test coverage and integration test coverage in our most important repository.

Now we have 100% code coverage for both unit and integration (API) and a branch coverage above 90%.

Besides this he always tests his own code, with both wide and deep understanding of the requirements. He always ask for feedback regarding his own testing, wants critical code reviews and practises risk-based exploratory testing.

This is what QA-coaches and testers will have to work with in the future. How do we create value for these future developers?”

….What are your thoughts regarding my friend’s question? How can testers provide value to developers who deeply care about code quality and at the same time are good at testing themselves?” (2)

The point raised by David Högberg is important and should not be ignored. Also, I saw that some testers were somehow speechless regarding this, like there was nothing to say/do/challenge/help.

There are lots of things testers can do. Testers must/can challenge things and there is a lot to challenge. So, for example:

1. The fact that what the developer does are unit checks , integration checks not tests.(3)

2. He said that he reached 100% code coverage for unit checks and integration checks. Actually code coverage is a measure and number for programers only. This is because it helps the developer to see areas not covered at all, not how well that area of code is covered. So, this number should not be exposed to management, because you can have 100% code coverage without code actually being covered. From the moment when you hear that code coverage number is exposed, there might be trouble – I know it sounds strange, but for me is a sign of exaggerated confidence. Maybe I am wrong, but for me is a heuristic for looking with care, because of the things which can’t be articulated in simple boolean confirmation statements.

I have to say that each time when I discuss with managers I try to do my best to convince them to ignore the code coverage number and the fact that it means nothing.

By the way, when I have the occasion I ask programers this simple question: So you are so confident with the unit checks?  If the answer yes, then I ask: Good, are you ready to bet you salary for 3 months that I’ll not find any problems? Usually, I perceive hesitation.

A good technique to verify the actual lines/conditions, in terms of coverage, is mutation checking(4). Even with this technique, I have in my mind the difference between testing and checking! (3)

3. As a tester you can help the developer with the sampling, the data she/he is choosing. And, as you know, this is not a skill which can be learned in a day or two. Sampling at the unit and at the integration level is important and I saw a lot of times unit checks and integration checks which repeat themselves.

I do not mention that testers, need to know very well about cognitive biases, critical thinking.

4. The developer said that he/she made unit checks? Perfect. Challenge that. Take a look at this brilliant article by James Coplien: Why Most Unit Testing is Waste . You’ll notice that this article is not so easy to digest, is deep – it speaks about the theory of information, also it does not follow the current dominant thinking about unit tests. I’m sure it will help you to make that developer think. Maybe negative reactions can take place, but is OK, we want fruitful disagreements.

5. The developer said he/she is doing TDD? TDD does not help at big architecture and OOP. It helps, maybe, at the micro level, but for sure not macro. This means architecture, OOP is fully exposed in a big and nasty ways. Maybe integration checks can help to see that the parts are fitting together, but are not helping to see that they are ok built. What this means? Well… nasty things are hidden at the integration boundaries. Developers don’t do OOP, but Class Oriented Programming. OOP would mean to reflect the mental model of users, which this does not happen. All the work is split between a lot of classes and functions. I think you can imagine the dangers.

Regarding TDD, I noticed that some persons begun to make some research about it and it is interesting: A Comparative Case Study on the Impact of Test-Driven Development on Program Design and Test Coverage or Does Test-Driven Development Improve the Program Code? Alarming Results from a Comparative Case Study

By the way, I also liked this post: TDD is dead. Long live testing

So, please, go and see the research, I doubt a lot of programmers do that…

6. Unit checks and integration checks is also code, this means that is prone affected by things like: bugs, maintenance, design, analysis, architecture.

7. I love the article of Max Boisot with the patterns(5). For example: for 10 dots there are 45 possible links and 3.5 trillion possible patterns. I’m sure in applications there are more than 10 connected dots. Is not possible for a developer, no matter how smart he/she is, to be sure he/she covered all the possible patterns and also to be aware which pattern is more important than other(s).

8. Regarding “A backend developer has been very productive this sprint, he has pulled in more tickets than planned and finished those.” Maybe I’m interpreting this in a wrong way, but sorry… I’m not interested in the productivity of the developer. This is a very nasty stuff. For me is important that the team and the whole work to be ok. When I read productivity of individual, I begun to doubt the good functioning of the team and this is bloody dangerous. Is like measuring tester for the bugs introduced, sorry, but no. Were there any other members actually working on stuff? If yes, why he did not took care to help finish that?  – I’m deducing this from the text, maybe I’m wrong. In Scrum the team works on a single PBI at a time.

Still the list is short. I would have added about cognitive dissonance, of how the team structure affects the code structure, but you got the idea…

Conclusion: So how testers might create value for these kind of developers? I think that when a tester will put this question then is a good sign because learning/helping continues.


(1) Michael Bolton, “RST Slack Channel”, https://www.developsense.com/blog/2017/10/rst-slack-channel/

(2) Text used with permission, thx David Högberg

(3) James Bach, Michael Bolton,”Testing and Checking Refined”, https://www.satisfice.com/blog/archives/856

(4) Robert C. Martin, “Mutation Testing”, https://blog.cleancoder.com/uncle-bob/2016/06/10/MutationTesting.html

(5) “The problem of connecting the dots”, https://sensing-ontologies.com/the-problem-of-connecting-the-dots/

A discussion about code, data structure, objects

Shu: I need your opinion on something related to code. Maybe the other person, with which I discussed,  is right. But still something I feel is not ok.

Ri: Ok. Tell me more.

Shu: I need to pass to the UI a list of address types. For example address type of home, or address type of work,… My initial idea was to send a simple collection with key value pairs. Something like:

           new Dictionary<int, string>{{ 1, “Work” }, { 2, “Home” }}

           or

           new List<AddressType>{AddressType.Home, AddressType.Work}

           where AddressType is an enum type

And then the UI would know what to do.

Ri: Ok

Shu: My problem is that at a code review I was being told that I should return “a list of objects”. And each “object” should contain the same 2 data. Something like:

           List<AddresTypeData>{new AddresTypeData{Id= 1, Name=”Work”}, new AddresTypeData{Id=2, Name=”Home”}}

Why the latter is better than the first?

Ri: It’s not. Conceptually are the same thing. Ok, we can speak of some advantages regarding reading the code, or what happens at runtime. But, I think that something else needs to be clarified tough.

Shu: What?

Ri: The reviewer said “object”?

Shu: Yes

RI: What he proposed is an object?

Shu: Yes

Ri: Look …<<a sigh>>… is a big difference between a data structure and an object. Maybe what he wanted to say is that he wanted to represent the idea of Address type in a different data structure, this is a different thing.

Shu: I do not understand what you are trying to explain.

Ri: Look, objects are like biologic cells(1). Cells which communicates between them to do something. Those cells have a sense in an ensemble of connecting cells, ensemble which tries to do a certain thing. What cell send to another cell is a message. (For example, for neuro cells from the brain that message is an electrical signal. This electrical signal jumps from a cell to another, is not continuous. This message flows via synapses. ). Those messages can have their own structure, but there are still messages. A cell will not do the work of another cell, and the cell will know to whom to send the message. An object you’ll see it truly only in the connection with the other objects, which as a whole try to solve something.

Shu: What do you want to say?

Ri: Semantics matters, and for me it was a sign of confusion of what objects and OOP mean. And I wanted to underline this. You were speaking about data structure of a message not objects, which are a different thing.


(1) Alan Kay, “Dr. Alan Kay  on the meaning of “object-oriented programming””, https://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_de