Google Testing Blog: Hackable Projects – Pillar 1: Code Health

Hackable Projects – Pillar 1: Code Health

In this blog post, author Patrik Höglund talks about how over the years, software development can become stressful to deal with and fix constant issues. The way he suggests to resolve this issue is by making the software more “hackable”; not in the sense of making the software more vulnerable to attacks, but making it easier to modify from a developers stand point. Höglund goes on to say that a hackable project is one that includes easy development, fast builds, good and fast tests, clean code, easy running and debugging, and “one-click” rollbacks. Höglund then goes on to describe the three main pillars of hackability, which are code health, debuggability, and infrastructure.

This post focuses solely on the first pillar of hackability: Code Health.
The first thing Höglund covers are tests that you should use. He says that “unit and small integration tests are probably the best things you can do for hackability” rather than using end-to-end testing. The other thing to testing is that if you have poorly tested legacy code, the best thing to do is refactor it and add tests along the way. Even though this can become time consuming, it’s work it in the end because it leads to a more hackable system in the long run.
The next thing that should be done is to make sure that your code is readable and goes through code review. This means that there should be a reviewer who looks over the code changes to make sure that the new code is consistant with the rest of the code. The changes should also be small and coded cleanly so as to make it easy if a rollback is necessary. Another thing that will help with hackability is making sure that all of your code is submitted in a constistant format.
To reduce risks even more, you should try to consistantly have a single branch for your project. This not only decreases the possible risks, but also reduces the expense of having to run tests on multiple branches. This could possibly back fire though if, as Höglund writes, “Team A depends on a library from Team B and gets broken by Team B a lot.” Höglund suggests that “Team B might have to stabalize thier software for them to use this method and have hackable software.
The last things that Höglund focuses on for Code Heath is making sure that your code has loose coupling, testability, and ways that you can aggressively reduce technical debt.

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

What Makes a Skilled Developer: A Sound Knowledge in Design Patterns

Nowadays top tech-companies are willing to pay huge amounts in recruiting capable architects, developers and designer who can deliver software that is elegant. Elegant software is software that is easily testable, easily extensible, and are free of defects. In today’s day and age, good design of software is critical to the long-term sustainment of the software in the market.

Thus, a software developer must be skilled at the respective areas to be able to develop elegant software. And the only way to acquire these skills is by experience, a lot of it, around 10-15 years of working as a designer or architect would be ideal. But nowadays businesses can’t afford to wait that long to get a developer of that caliber. They want schools to produce these engineers right of their ‘assembly line.’ As such an alternative route is needed. Another way to become a skilled developer is to study design patterns. Design patterns are knowledge in the form of a template that could be used to solve general repeatable solution to a commonly occurring problem. But it is important to note that a design pattern is not the finished product that can be directly translated to code.

But design patterns have its fair share of criticism as well. Very often using design patterns leads to inefficient solutions due to duplication of code. Thus, care should be taken in this regard.

Works Cited

https://sourcemaking.com/design_patterns

Burris, Eddie. Programming in the Large with Design Patterns.

From the blog CS@Worcester – thewisedevloper by thewisedeveloper and used with permission of the author. All other rights reserved by the author.

Ugh! PHP Unit Testing

I tend to spend a lot of time programming in PHP in my free time. One of the things I have been looking at, since I am taking a software testing class, is PHPUnit and unit testing in PHP. I was getting discouraged with how odd PHPUnit seemed in comparison to the ease of use of something like JUnit. I stumbled upon this blog post that is a conversation between two people about PHPUnit.

The conversation starts with Ed explaining how he doesn’t like PHPUnit specifically:

Ed: I guess realistically my complaints are aimed at PHPUnit . It’s very powerful and very complete from what I can tell, but I think it’s difficult to pick up and I think that difficulty makes people less likely to use it. Because it’s by far the best known testing tool, I think that tends to limit the use of unit testing, period, in PHP.

He goes on to state how other languages have unit testing support that are far easier to use. Java and Python for example have extremely easy to use unit testing frameworks/built in features.

After a little while he continues to explain the reasons he believes PHPUnit is so intimidating:

Ed: I think boilerplate is part of the issue. I think that’s intimidating. Tools can mitigate that to some extent, but I don’t think it eliminates the problem entirely. I just don’t think writing a simple test should be anything more than a couple lines of code.

Previous to that quote the other host, Chris, gave a snippet of a simple unit test and it required 17 lines of code to simply write one assertion. That seems absurd!

At the end of the post Ed notes something that is very important and relates closely to TDD:

To write testable code, you really have to be thinking about testing when you write your code. It takes a bit of time to get used to that, but I think it’s very doable.

The number one reason that PHP developers have a tough time thinking in this manner is due to the fact that most of them are self taught. PHP has a really small learning curve which is great for people who want to get into web development, but in order for PHP unit testing to move forward and to better things, more developers have to get into the TDD mindset.

 

P.S. I find it amusing that in my WordPress (Mainly written in PHP) post editor, the acronym PHP isn’t included in the base dictionary.

From the blog CS@Worcester – Tyler Lundstrom by CS@Worcester – Tyler Lundstrom and used with permission of the author. All other rights reserved by the author.

Lessons to Learn from Kent Beck the father of TDD

In a podcast I listened to earlier this week from PythonTesting, Test & Code podcast, I was able to hear from the “father” of TDD himself Kent Beck. In this podcast, the host Brian took snippets from a Software Engineering radio podcast (Episode 167) that, what he thought, would have the most impact on the listener.

These are the 5 things Brian decided to look at:

  1. You’re tests should tell a story.

  2. Be careful of DRY, inheritance, and other software development practices that might get in the way of keeping your tests easy to understand.

  3. All test should help differentiate good programs from bad programs and not be redundant.

  4. Test at multiple levels and multiple scales where it makes sense.

  5. Differentiating between TDD, BDD, ATDD, etc. isn’t as important as testing your software to learn about it. Who cares what you call it.

One interesting thing I noted from this was point number 2. Being careful of writing test that align with common software design practices. This kind of went hand-in-hand with point 1 where he says your tests should tell a story. Each individual test should tell the person reading it, what was being accomplished at that given point. For example if you try to use the Don’t Repeat Yourself (DRY) philosophy then you won’t be able to see that story as well in your tests because you’ve tried consolidating the repeats.

From the blog CS@Worcester – Tyler Lundstrom by CS@Worcester – Tyler Lundstrom and used with permission of the author. All other rights reserved by the author.

Mutation testing

In the blog on mutation testing, the author talked about the need to basically test your tests. This mutation testing will deliberately introduce bugs into the code and verify that your unit test will fail. I definitely have written so bad unit tests before where it will execute my program and pass the test regardless of what the code actually does.  This white box testing method is a very interesting way to ensure a higher level of reliability in your code.

On the other side of the spectrum, the Microsoft blog criticizes many projects that require an extreme high test coverage where it leads to a massive burden to development while catching few bugs.  How many projects in real life have the time to not only unit tests completely but also do something like mutation testing. Let’s not even get started on working and testing on legacy codes.

 

Mutation testing: testing your test cases

https://medium.com/@s4n1ty/experimenting-with-mutation-testing-and-kotlin-b515d77e85b5#.er96cssn5

Stop writing bad tests

https://blogs.msdn.microsoft.com/ericgu/2016/10/09/stop-writing-bad-tests-write-only-the-tests-that-you-can-do-great/

 

Further Readings

Oracle denied new trial over API trial.

http://www.pcworld.com/article/3125113/oracle-denied-new-trial-in-copyright-dispute-with-google-over-java.html

Disney open source project

http://disney.github.io/

Static vs dynamic typing

https://blog.jooq.org/2014/12/11/the-inconvenient-truth-about-dynamic-vs-static-typing/

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

I’ll Test It Later…

I’ll test it later. I am sure at during one point or another in all our programming careers we have told ourselves this before.

I came across an interesting article about Twyla, an engineering company who is training their employees’ to dedicate more quality time to testing practices. If you had to choose between writing code to test a program or writing code for the actual program, many would choose the latter. We feel some sense of accomplishment and progress in coding the program while coding the tests does not. “Why am I coding tests for a program that hasn’t even been created yet?” Some might think that this approach is a waste of time but I would argue that it actually saves you time in the long run because you will run into possibly less errors since the tests echo the necessary behavior of the program. Twyla encourages their QA teams to sit down together once a week for an hour for product testing which I think is a great idea because not only would it increase our testing capacity but our social abilities as well. QA testing, like anything else, only gets better through practice and what better way to do that than to sit down with others, share ideas and have a testing frenzy!

Link: https://www.rainforestqa.com/blog/2016-10-13-how-to-build-a-culture-of-quality-a-case-study-of-twyla/

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.

Mutation Testing

Week 3 Blog Post

This week i decided to read Mutation Testing – Learn This Interesting Testing Technique Quickly with a Simple Example by Swati S.

Mutation Testing is something that i was not very familiar with before reading this article. However after reading it i have a much better idea of the ideas behind this form of testing. Mutation Testing is defined as “Mutation testing is a fault based testing technique where variations of a software program are subjected to the test data-set. This is done to determine the effectiveness of the test set in isolating the deviations.(Swati, 1). The interesting thing about the article is that it taught me about mutation testing by using an example. I will attempt to summarize this example in my post in order to reinforce the idea in my own head as well as to help anyone else who is interested in mutation testing.

We are given the following Pseudo Code:

1) Read Age
2) If age>14
3) Doctor= General Physician()
4) End if

Mutation testing uses something known as mutation operators in order to identify problems with the original code. These include arithmetic operator replacement, logical connector replacement, statement removal, relational operator replacement, and absolute value insertion.

Examples of these mutations:

1) Read Age
2) If age = 14 – The greater than was changed with =, it could also be changed to < or <=
3) Doctor= General Physician()
4) End if

For a full mutation test you would create a large number of these mutants and then run those and the original code against your data set. When this is done all the mutants should be “killed”, this means that the test data made them fail.

Of course this example is extremely easy compared to what it is like to actually implement mutation testing. The  operators may also change depending on the type of application and the programming language that is being used. Although i may not be ready to sit down and start writing mutation tests the article and the example provided have given me a much better understanding of the topic as a whole.

Other interesting Articles that i looked at this week:

Accountability for What You Say is Dangerous and That’s Okay

http://qahiccupps.blogspot.com/2016/09/i-can-manage.html

Chrome OS Test Automation Lab

Automated Accessibility Testing for Android Applications


From the blog CS@Worcester – Computer Science Journal by jtassone93 and used with permission of the author. All other rights reserved by the author.

The Basic of Software Testing (Week 4)

This post is dedicated to the fundamentals of software testing. First is important  to learn and practice the basic of software testing techniques before you step into the advanced testings. In this article, I’m listing the eight most important basics of software testing that are very important to master before you move forward.

  1. Software Quality-Software quality is the degree of conformance to explicit or implicit requirements and expectations.
  2. Dimensions of Software Quality- There are so many dimensions, here I listing some of them: Accessibility, Compatibility, Concurrency, Efficiency, Functionality, Functionality, Installability, Localizability, Maintainability, Performance, Portability, Reliability, Scalability, Security, Testability, and Usability, there are more dimensions but this is the most useful dimensions to know before you step forward with software testing.
  3. Software Quality Assurance- Software Quality Assurance is a set of activities for ensuring quality in software engineering processes.
  4.  Software Quality Control- Software Quality Control is a set of activities for ensuring quality in software products.
  5. SQA and SQC Differences- SQA is process-focused and prevention-oriented but SQC is product-focused and detection-oriented. 
  6. Software Development Life Cycle-Software Development Life Cycle defines the steps/ stages/ phases in the building of software.
  7. Software Testing Life Testing- Software Testing Life Cycle (STLC) defines the steps/ stages/ phases in the testing of software. 
  8. Definition of Test- Merriam Webster defines Test as “a critical examination, observation, or evaluation”. 

These eight basic concepts are important to go more in depth because can help us to be beter software tester in the future.

Here you can read more about these concepts: Click Here

Citation
http://softwaretestingfundamentals.com/software-testing-basics/


From the blog Table of Code by Andon S and used with permission of the author. All other rights reserved by the author.

The Basic of Software Testing (Week 4)

This post is dedicated to the fundamentals of software testing. First is important  to learn and practice the basic of software testing techniques before you step into the advanced testings. In this article, I’m listing the eight most important basics of software testing that are very important to master before you move forward.

  1. Software Quality-Software quality is the degree of conformance to explicit or implicit requirements and expectations.
  2. Dimensions of Software Quality- There are so many dimensions, here I listing some of them: Accessibility, Compatibility, Concurrency, Efficiency, Functionality, Functionality, Installability, Localizability, Maintainability, Performance, Portability, Reliability, Scalability, Security, Testability, and Usability, there are more dimensions but this is the most useful dimensions to know before you step forward with software testing.
  3. Software Quality Assurance- Software Quality Assurance is a set of activities for ensuring quality in software engineering processes.
  4.  Software Quality Control- Software Quality Control is a set of activities for ensuring quality in software products.
  5. SQA and SQC Differences- SQA is process-focused and prevention-oriented but SQC is product-focused and detection-oriented. 
  6. Software Development Life Cycle-Software Development Life Cycle defines the steps/ stages/ phases in the building of software.
  7. Software Testing Life Testing- Software Testing Life Cycle (STLC) defines the steps/ stages/ phases in the testing of software. 
  8. Definition of Test- Merriam Webster defines Test as “a critical examination, observation, or evaluation”. 

These eight basic concepts are important to go more in depth because can help us to be beter software tester in the future.

Here you can read more about these concepts: Click Here

Citation
http://softwaretestingfundamentals.com/software-testing-basics/


From the blog Table of Code by Andon S and used with permission of the author. All other rights reserved by the author.

The Basic of Software Testing (Week 4)

This post is dedicated to the fundamentals of software testing. First is important  to learn and practice the basic of software testing techniques before you step into the advanced testings. In this article, I’m listing the eight most important basics of software testing that are very important to master before you move forward.

  1. Software Quality-Software quality is the degree of conformance to explicit or implicit requirements and expectations.
  2. Dimensions of Software Quality- There are so many dimensions, here I listing some of them: Accessibility, Compatibility, Concurrency, Efficiency, Functionality, Functionality, Installability, Localizability, Maintainability, Performance, Portability, Reliability, Scalability, Security, Testability, and Usability, there are more dimensions but this is the most useful dimensions to know before you step forward with software testing.
  3. Software Quality Assurance- Software Quality Assurance is a set of activities for ensuring quality in software engineering processes.
  4.  Software Quality Control- Software Quality Control is a set of activities for ensuring quality in software products.
  5. SQA and SQC Differences- SQA is process-focused and prevention-oriented but SQC is product-focused and detection-oriented. 
  6. Software Development Life Cycle-Software Development Life Cycle defines the steps/ stages/ phases in the building of software.
  7. Software Testing Life Testing- Software Testing Life Cycle (STLC) defines the steps/ stages/ phases in the testing of software. 
  8. Definition of Test- Merriam Webster defines Test as “a critical examination, observation, or evaluation”. 

These eight basic concepts are important to go more in depth because can help us to be beter software tester in the future.

Here you can read more about these concepts: Click Here

Citation
http://softwaretestingfundamentals.com/software-testing-basics/


From the blog Table of Code by Andon S and used with permission of the author. All other rights reserved by the author.