The Clean Coder Chapters 5 and 6

 

Chapter 5 in The Clean Coder is about Test Driven Development. There are three laws when it comes to Test Driven Development. They are:

1.) you are not allowed to write any production code until you write a failing test.

2.) you are not allowed to write more of a unit test than is sufficient to fail, and not compiling is failing

3.) and you are not allowed to write more production code that is sufficient to pass the currently failing unit test.

Following these steps makes it so that you have to test the code every step of the way. This can avoid all the errors being thrown at you at once if you don’t test till you are done writing your code.

Chapter 6 is about practicing your coding. It is true that it is your job to keep your skills sharp and not your employers. Therefore practicing should be done on your own time. The example of a surgeon not being paid by a patient to practice before going in to the surgery room was made, and it helps put things into perspective. Keeping your skills sharp, and your resume tuned, should be done on your own time.

From the blog CS@Worcester – Site Title by jonathanpaizblog and used with permission of the author. All other rights reserved by the author.

Reflection week 3

This week we reviewed what we did last sprint. We completed our peer evaluations, which were all good, but at this point it is hard to tell how our peers are doing because we haven’t done much collaborating. We all did a good job keeping up with the tasks that needed to be completed for this sprint. We also god a overlook on what we were going to complete next sprint, this next sprint was all about setting up AMPATH and OpenMRS and modify some existing code to get it working. Next week i plan to successfully re structure the code and get it working, as well as getting AMPATH and OpenMRS working. This week was kind of slow in terms of work that needed to be completed, so i looked at some more angular stuff.

From the blog CS@Worcester – Site Title by jonathanpaizblog and used with permission of the author. All other rights reserved by the author.

The Clean Coder: Chapters 7 & 8

In the 7th chapter “Acceptance testing” author Martin discuss about the communication aspects between programmers and stakeholders. Then he drives into the essentials of having acceptance tests to narrow the communication gap. Martin argues that in reality, the communication of requirements is extremely difficult. Because of which both programmers and stakeholders often falls into various miscommunication traps such as premature precision, estimation anxiety, and late ambiguity. Then Martin suggests a solution: is to write automated acceptance tests. Acceptance tests helps to define when a requirement is ‘done’. Due to cost reason acceptance tests should always be automated. Professional developers should take responsibility for their part in ensuring that acceptance tests are automated.

Furthermore, Martin clearly states acceptance tests not being the same as unit tests. Although they may test the same things, they do so through different mechanisms and pathways. Unit tests validate the system from the developer’s point of view whereas acceptance tests validate the system from the business and QA points of view.

Moreover, the chapter talks about the challenging to write acceptance tests for GUI. Alongside suggests the solution to design the system so that you can treat the GUI as though it were an API.

I personally know how to write unit tests as being a programmer. I don’t have any experience as of now as a stakeholder. From my part I will definitely make sure that the tests are fully automated and easier for non-programmers to understand. I will specify all the details during my testing phase for the stakeholders to ensure that the system they are paying for really does what they need.

The next Chapter “Testing strategies” revolves around the disciplines of Test Driven Development. Author explains about unit, component, integration, system, and manual exploratory tests. The test automation pyramid diagrams summaries the concept of those test. Author argues that unit tests provide as close to 100% coverage as is practical. As good as it is to have a suite of unit and acceptance tests, higher-level tests are needed to ensure that QA finds nothing.

I am not exposed to any other tests rather than unit. I will definitely work together with QA team to ensure the quality of the system.

From the blog CS@Worcester – Software Dev Capstone by osworup007 and used with permission of the author. All other rights reserved by the author.

The Clean Coder Chapter 7 & 8

Chapter 7:

This chapter is mainly based around the idea that communication is key and is necessary for a developer have, not just their ability to develop. It is very difficult to keep up with what you think the business side of developing would want and what they actually want or think you are doing. With that in mind, the programmers can only make what they Think is wanted from them, and so this process is filled with errors. It also talks about how not only developers, but also business have a problem with their premature precision. Both sides, business and developer usually want to know an estimate of what people are going to get and what you are supposed to deliver to give an exact estimate of how long the process should take, but this task is nearly impossible. Also the outcomes of a product usually end up being different from how it was planned on paper simply because it doesn’t always come out how you imagine or plan it to. What helps this ambiguity sometimes is acceptance tests. Acceptance tests are tests written in a collaboration of stakeholders and programmers in order to define when the requirement is done. This all helped me realize and look back at times that ambiguity could have led to some miscommunication in the group which effected a person to think that they were done with their work, when they were not. So using acceptance tests would help by making it all much more clear than before and help define the context of the problem in precision and communicate its context clearly.

Chapter 8:

This chapter teaches about the fact that writing unit and acceptance tests is good but not enough, what you really need is to have good testing strategies. Even though the company you work at might have its own QA group, you should not use them to find your bugs, your goal should be to eliminate any bugs that could be present in your code, before it even gets into QA hands. They should be working together with you and your team to try to make sure the high quality set for the system is actually reached. Now even though your goal is to try as hard as you can that no bugs should slip through, that is plain impossible and that is the whole reason the QA group is there, to help you catch the bugs you missed. I also learned that QA work with business and make automated acceptance tests that establish the true specifications and requirements document for the system. While the business updates and gives their requirements, the QA then turn that information into tests for the developers.  This also showed me that the QA group is there to use testing to see the true behavior of the running system and report it back to the developers and business, not interpret the requirements.

From the blog CS@worcester – CS Blog by Gautam by csblogbyg and used with permission of the author. All other rights reserved by the author.

Week : The Clean Coder, Ch. 7 & 8

Chapters 7 and 8 of The Clean Coder are about testing. Chapter 7 is about acceptance testing and chapter 8 is about testing strategies. Acceptance tests are tests that are written by the developers and end users together. The aim of these tests is to agree upon what it means to be done. The author speaks about defining done. The author “Professional developers have a single definition of done: Done means done.Done means all code written, all tests pass, QA and the stakeholders have accepted. Done.” I personally like this attitude. If a development team is not upfront about what it means to be done it can lead to confusion, an incomplete product, or a missed deadline. When a team member says that the task they were working on is done the other members should be able trust that it is done and does not need to looked over by others. This is a common problem in group assignment in school. A project may be broken up in to individual tasks and on person is responsible for putting the final pieces together and submitting. To often the person responsible for the final submission assembles all the pieces only to find out some of those pieces are really not complete, they then frantically work to finish and submit the project.

In chapter the author makes the statement ” QA should find nothing”. I know, as the author also pointed out, this is an asymptote, there is a reason the company has a QA team. That being said, I like the attitude the statement conveys, developers should take pride in their work and aim to produce good, clean code that is as close to error free as possible. A developer should never say “Don’t worry, QA will catch it.”

From the blog CS@WSU – :(){ :|: & };: by rmurphy12blog and used with permission of the author. All other rights reserved by the author.

The Clean Coder Chapters 7 & 8

Definition of “Done”, Acceptance Testing are both built off of communication. This is key when trying to convey your programming needs to a developer or vice versa. The definition of Done in my opinion and in what the author presented us is a moral of “Done” means many things to many people and it is important to establish your system/meaning of “Done”.

The next big topic was Agreement Testing. From personal experience I know how in a corporate environment the managers may not know exactly what they want until you build what they ask for. Then as the author tries to emphasis that they will always have changes. This is said to be because now they how more information on how it looks and what they can perceive to be most efficient. Also Agreement Tests are NOT Unit Tests…..its explained pretty clear that the access points for execution are expected to be different for a Agreement test. This also is where he went into a useful tangent to point out that the underlying framework for your GUI should be consistent but the GUI layout itself can change fluidly.

Chapter 8 discussed more about testing.Of course I think this author has unrealistic benchmarks yet they are great to strive for. He seems very stern in the words used to state Quality Assurance should find nothing. This is a topic we discussed in depth in our last semester course on integration testing, unit testing, what defines a unit etc.Yet the important point he stresses is that unit tests are for the programmers. The component tests are for the Agreement Test, and the integration testing is for large systems when piecing many components together, and the System test is where the entire program is tested from an outside perspective that is all works as one system.

From the blog CSWSU – Triforce Code| Exploring and Learning by CSWSU – Triforce Code| Exploring and Learning and used with permission of the author. All other rights reserved by the author.

The Clean Coder Ch. 7 and Ch. 8

If you were feeling a void in your heart for some more testing since chapter 5’s lesson on TDD, then chapters 7 and 8 are sure to get that blood pumping organ to swell.  Chapter 7 is called “Acceptance Testing” and focuses on how to determine when a programmer has completed a requirement.  Chapter 8 is called “Testing Strategies” and focuses on the “The Test Automation Pyramid” which I provided below.

Screen Shot 2017-02-14 at 12.23.36 PM.png

In chapter 7, Robert C. Martin gives his “Definition of Done” which is accomplished when “all code is written, all tests pass, QA and the stakeholders have accepted.”  Just today our development team drafted our own Definition of Done.  Ours contains slightly different criteria as we are not engaging in TDD.  Additionally, due to our constraints, do not have the time or resources in order to produce automated acceptance tests as Martin suggests.  He focuses immensely on how integration testing through a continuous integration system is the best form of communication between programmers and stakeholders.

In chapter 8 Martin focuses on test coverage.  He believes that unit tests should cover 100% of a programmer’s code, although he admits that 100% coverage is unrealistic.  He also suggests component tests should cover about 50%, integration tests about 20%, and so forth.  Martin suggested, once again, that he believes that QA should find nothing wrong with the software that they are reviewing.  However, in this and the previous chapters, he explains that QA has the responsibility of writing the acceptance tests in conjunction with the stakeholders.  Therefore, if QA does a good enough job, and programmers ensure that their code passes these tests, then I finally agree with Martin. There exists a slim possibility that programmers can ship code to QA with some confidence that there exists no bugs in the code.

From the blog cs443 – TayNock's Blog by taynock and used with permission of the author. All other rights reserved by the author.

Week 4 (2/7 – 2/13) Clean Coder Ch. 7 & 8

When I decided that I wanted to become a programmer, I thought it would be 99% program code and 1% test code. I thought I could mindlessly write as much code as I wanted and just know if it works or not by running it. I was wrong. Completely wrong. After having more insight into being a software developer, I realize now that testing is so under-rated and overlooked. After reading chapters 7 and 8, this concept is reinforced even more.

If you really think about it, its quite simple. You want your program to work and the only way to know if it correctly works or not is to test it. This is where acceptance testing comes into play to tell you when a requirement is done and that is obviously important because if you don’t know the requirements then how would you even know what to test?

Chapter 8 was somewhat broad since it covers a big array of topics regarding which tests to use depending on which level of the system you are working on but nonetheless it was good review. It’s always good to review testing strategies because at the end of the day, your program is only as good as your tests are. 

From the blog CS@Worcester – Tan Trieu's Blog by tanminhtrieu and used with permission of the author. All other rights reserved by the author.

The Clean Coder Chapters 7 & 8

Most of chapter 7  and 8 were things I had already learned from the previous testing class that I had taken. He goes over that unit tests are different than acceptance test, always try to make automated tests because they are cheaper, and all the different types of testing their are and what each one of them covers in the system.
The main thing that I took away from this chapter was that you, as a developer, should make sure that clear communication is established between your team and the stakeholders that you’re working with. Primarily you don’t ever want to assume that the other party knows what you are talking about, or that you are on the same page.  These assumptions can, and usually will, lead to huge messes down the line that may result in your team having to fix the entire design of an application that you were building because you misunderstood critical information that the client was ambiguous on. So, moral of the chapter, never be afraid to ask question and bring in people that may help to clarify the story that the client gives you.
I did also find the small section on testing GUIs interesting. Martin points out that you should not test the GUI itself, but the under lying structure by designing they system to treat it like an API. This makes perfect sense when you think about it because a GUI will always be changing to whatever the clients preference is.

From the blog CS WSU – Techni-Cat by clamberthutchinson and used with permission of the author. All other rights reserved by the author.

Capstone Week 3

This week in capstone, we dig deeper in the OpenMRS project.

The steps we did this week

  1. Forked the openMRS git repo
  2. Got ng2-amrs to build and run
  3. Installed ng2-amrs standalone back end
  4. Looked over how the ng2-amrs authentication system worked

People initially had issues with setting up the system. This was actually an issue with multiple OS. People where using OS bash, Node.JS terminal, Bash on W10, and Git Bash. People were confused on what to use at first and we had to clear that situation up and also the different IDE people were using.

We tried to get an understanding of how the entire system works. Initially we set up the front end of the system but was confused on how we get the login system to work (the back end system). It wasn’t until some noticed that there is a standalone that is needed for the back end system that we realize that is actually where we auth.

Although we got everything to work in the end, the steps could’ve been made smoother if everyone was using the same OS and IDE so there’s no differentiating the set up process. Obviously this is much harder to do in a school environment, but having to trouble many different IDE and OS set up can be very stressful especially if a much more complicated project comes up.

Also people speaking up in a team environment is also key, not realizing we needed a back end, we fumbled around confused on how they got auth to work. Until one person spoke up about the back end and then we got confirmations from outside the team on how the entire thing worked.

From the blog CS@Worcester – Site Title by nealw5 and used with permission of the author. All other rights reserved by the author.