Top 5 Common Myths in Software Testing

I read the post “Top 5 Common Myths in Software Testing”,  this is a somewhat old post, but all of the myths mentioned inside it are still going around to this day.  The 5 myths that the author debunked in order were:

  1. Software Testing is a Mundane No-Brainer Job
  2. A Tester Should Be Able To Test Everything
  3. A Tester’s Job is to Find Bugs
  4. Testers Add No Value to The Software
  5. Test Automation Will Eliminate Human Testers

For the first myth, the author argues that the job is only mundane and boring if you are doing it wrong. He argues that testing cannot be boring if you see the process as information gathering and not just running routine tests looking for bugs.  For the second myth he argues correctly that testers are limited by a variety of different factors such as time, or inability to test certain cases because of the lacking infrastructure. The author makes it clear that while one of the key roles of a tester is to find bugs, it is not their only, (and this also leads to the next myth) testers ensure that the product actually meets the requirements, make sure the product is user friendly, etc. He also explains why he believes that Automation will never replace human testers, and that reason is emotion. Essentially he believes that no matter how advanced Automation becomes it will never have that human perspective.

The reason that I chose this post is because I had some preconceived notions about testing that were quickly proven wrong when I did an internship as a tester. I wanted to see if the things that I believed  before were any of the common myths inside this post. After reading the article I realized that I believed all the these myths before my internship experience.  The biggest one for me was “A Tester’s Job is to Find Bugs”, while this was true, we also had many more responsibilities. One thing that surprised me was the strict standards that the testers had for documentation, they took this REALLY seriously! If an API was not extensively documented, that would be considered a severe bug. That level of detail showed me that testing really isn’t just finding bugs, but also making sure that the product simply works, and most importantly is easy to use. This article really hit home the point for me.

It can be found at: http://www.softwaretestingtricks.com/2012/04/top-5-common-myths-in-software-testing.html

 

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

Writing “Clean” Code

https://www.thecodingdelight.com/write-clean-code/#ftoc-heading-2

As I learn more about computer science, I find that writing code for a programming project is very similar to writing an essay for an English project. I find that the core structure of a coding language mimics the core structure of any other language. A run on sentence can be compared to poorly using indentations, grouping your variables together at the top of the page is like having a well organized thesis statement. Just as we spend years taking English courses perfecting our grammar and sentence structure, it takes a lot of practice and learning to perfect our syntax and ability to write clean code.

Some benefits of writing clean code include:

  • Being able to easily follow your own code to track down errors
  • More efficient productivity
  • A more professional reputation
  • Your employer/teacher will resist the urge to strangle you

This article explains in detail why we should try to better our code and how to develop better habits from common mistakes. I for one, typically write messy code just hoping it will work and later try to buff out bad variable names, overly complicated methods, and half written comments. After reading this article however, I’ve learned tips and tricks for writing better code and how to embrace the clean code mindset. I can only imagine how many frustrated programming teachers’ evenings I’ve saved after reading this article, so for your own sake and for the sake of whoever has to look at your code, I recommend you read this article as well.

From the blog CS@Worcester – CS Mikes Way by CSmikesway and used with permission of the author. All other rights reserved by the author.

Writing “Clean” Code

https://www.thecodingdelight.com/write-clean-code/#ftoc-heading-2

As I learn more about computer science, I find that writing code for a programming project is very similar to writing an essay for an English project. I find that the core structure of a coding language mimics the core structure of any other language. A run on sentence can be compared to poorly using indentations, grouping your variables together at the top of the page is like having a well organized thesis statement. Just as we spend years taking English courses perfecting our grammar and sentence structure, it takes a lot of practice and learning to perfect our syntax and ability to write clean code.

Some benefits of writing clean code include:

  • Being able to easily follow your own code to track down errors
  • More efficient productivity
  • A more professional reputation
  • Your employer/teacher will resist the urge to strangle you

This article explains in detail why we should try to better our code and how to develop better habits from common mistakes. I for one, typically write messy code just hoping it will work and later try to buff out bad variable names, overly complicated methods, and half written comments. After reading this article however, I’ve learned tips and tricks for writing better code and how to embrace the clean code mindset. I can only imagine how many frustrated programming teachers’ evenings I’ve saved after reading this article, so for your own sake and for the sake of whoever has to look at your code, I recommend you read this article as well.

CS 343 Blog – New Theory on Deep Learning – 9/25/17

https://www.quantamagazine.org/new-theory-cracks-open-the-black-box-of-deep-learning-20170921/

This article from Quanta Magazine details a new theory on how the artificial intelligence algorithms behind deep neural networks are so successful. The theory, presented by computer scientist and neuroscientist Naftali Tishby, argues that deep neural networks learn by a procedure called information bottleneck. The theory states that a network gets rid of extraneous details in input data and only retains details most relevant to general concepts. In experiments, Tishby tracked how much information each layer of a network retained about the input data and output label. He found that layer by layer, the networks converged to the information bottleneck theoretical bound. This is the theoretical limit that represents the absolute best the system can do at extracting relevant information. Tishby’s discovery is an important step in figuring out exactly how neural networks work and gives a better understanding of which kind of problems can be solved by real and artificial neural networks.

I selected this article because artificial intelligence is an important and growing field in computer science. It will also have profound effects on society as systems like deep neural networks become more advanced. I think that as artificial intelligence continues to evolve it will become more important as a software developer to understand how A.I. systems work.

I thought that this article was very well written and did a good job of making a very complex subject understandable. From this article I learned the basics of how a deep neural network works. I think it is very interesting how the design is inspired by the architecture of the human brain. I also thought it was interesting how we aren’t even sure exactly how deep neural networks learn, and the information bottleneck theory that is detailed in the article could end up being a very important advancement in this technology. Naftali Tishby’s quote in the article summarizes the basic idea of this theory: “The most important part of learning is actually forgetting.” Tishby believes this is a fundamental principle behind learning whether you’re an algorithm or a conscious being. I think this is a very interesting viewpoint on learning that I did not know about before this article. Tishby believes that deep neural networks learn by receiving a large amount of input and then “forgetting” information that is not relevant until there is an optimal balance of accuracy and compression in the final layer. Overall I think this idea is very intriguing and is something that I would like to learn more about.

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

B2: Automatic Code Transplants

Automatic Code Reuse

            This week I found another MIT article that piqued my interest which explains the modifications a system makes to “transplant” code from one program to another. The article explains that the Computer Science and Artificial Intelligence Laboratory at MIT develop a system where programmers can copy code from one program and using an insertion point, move it over to another program. The interesting part is that the system will make any modifications necessary to integrate the code into the new program like change variable names. They tested CodeCarbonCopy on many open-source image-processing programs with seven of eight transplants working successfully. For this system to work, both programs need the same input file and then the system compares how the programs process the file. Once it finds similarities between variables, it first displays those similarities to the user and then displays the variables that were different. The user then can decide to flag certain variables that are not needed for the transfer and the system will excise any operations that use those variables. The system will also look at precise values in memory that both programs store and uses those values to generate a set of operations that translate the values into a data map. The article also explains that this program is still basic in usability but it does work well with file formats that follow a rigid organization that is easy to read. The researchers are trying to generalize the approach of this software to further allow multiple file formats so code from different file formats can be transferred to one another.

          I chose this article because it really shows the development within AI and computer science today. This option of automatic code reuse will make programs easier to understand and create. The ability to copy code from one program to another is incredible but the best part is that the system can now understand what each variable value means and display the similarities between two programs. This would also allow the system to make a program in multiple languages by reconfiguring the values into the desired language. I think that this jump in technology really can make life easier for programmers but it also brings up the point of stealing code from others. If this program ends up doing what it was originally designed to do then people can take code off the internet and use this program to change it into a new program that they could call their own. That aside, it would be interesting to see how the computer would take on the challenge of creating the software architecture between different languages as the syntax and naming system are different based on the language used. The article showed me that AI technology is really starting to kick off now and about the relationship two programs can have based on the values they store within memory.

From the blog CS@Worcester – Student To Scholar by kumarcomputerscience and used with permission of the author. All other rights reserved by the author.

Why is Testing Code so Important?

We’re approaching week four in the semester and getting into the processes of testing code. Prior to taking this course, I’ve tested code typically with random input, ad-hoc style. But I am now learning new testing methods as well, which are more systematic and cover larger ranges of potential case failures. That being said, I would like to talk about unit testing in general, and why it is so important.

We do unit testing because we want to ensure that our code works. Sometimes it can be frustrating when we can’t get our code to do what we want it to do. We need to do thorough testing to weed out these problems. For instance, perhaps our code works sometimes, but not always, and we have no idea why.

It can be disheartening when spending hours trying to fix something in your code which seems to magically work for some inputs, but then crashes on others. It seems that simply entering a finite and/or random number of test cases, or simply not running tests frequent enough, we may not ever find out why our code only works sometimes, but not always.

Now that I’ve discussed a few reasons why I feel that unit testing is important, I would like to share a blog that I found on the topic as well.

The Green Machine (TGM): 5 Reasons Why Unit Testing is fun–and Important

As the title suggests, TGM provides additional clarification as to why testing code is an essential part of programming. He also emphasizes that unit testing is fun as well, for a variety of reasons.

For instance, TGM states that unit testing can be rewarding in the sense that “we can execute our code right away and know that it works.” Since one of the most enjoyable aspects of programming is seeing the result of our work, having the capability to test our code at any given point is beneficial. And if for some reason it doesn’t work, we can likely figure out where it went wrong faster if we’re testing in a frequent and consistent manner.

Unit testing can also lead to an overall better understanding of how our code works. As TGM indicates, unit testing helps us figure out how our code will behave under a large range of circumstances. By running frequent tests, we can gather a better understanding of exactly what our code is doing, regardless if the tests pass or fail.

TGM’s blog was an interesting read for me, especially in regard to his insights of how unit testing can be rewarding. I’ve always known that testing code was important for functionality reasons, and now I feel that frequent testing can help make me a better programmer in general. This is due to what TGM indicated about how we can learn more about our code through its behavior during pass/fail tests.

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

Interfaces

URL: http://www.codingblocks.net/podcast/episode1
So for the second blog, I did end up sticking to the same website and people I had listened to last week. The reason for this was, I had found a couple other podcasts I had liked, but they were harder to hear, and I just felt like I wasn’t as interested in hearing just one person talk. I really like the setup that Coding Blocks has with three people. So the topic I chose for this week was interfaces, which I know doesn’t completely have to do with computer construction, design and architecture, but from working in Eclipse from last week, I felt like it was just a good idea to watch another kind of  “back to the basics” video. Also, interfaces was just another topic I have always had a hard time understanding and I felt like it just helped me a lot with the understanding, just like encapsulation.      Now, just like last week, the speakers started off with a simple definition of what an interface was, “A contract of what you have to adhere to in your program, if there is something in the interface, you have to make it do something”. Pretty much, how you should interact with that piece of data. A good way that one of the men put it was that it is like two different kinds of people, there is Joe who visits his grandma, and the joe who goes to the bar. They are still Joe, but just different portrayals at the appropriate times and places. After that, they went on to describe the differences between an abstract class and an interface.  In an abstract class, you want to provide some implementation as part of it, but you want to make sure some concrete information is defined and you want that user of the class to add on to that with their specific use cases and needs. Storage is assigned for members that the coder wants to have available public or private, while interfaces don’t have that and only have a declaration. Also, abstract classes have to be inherited.     What I found really interesting about this podcast though is that when they mentioned when implementing an interface, it will almost always be public, but there is that slight chance that it isn’t. This is the explicit interface case. The example that was given was that there were two different interfaces with the same method. The class needs to implement both interfaces, but when the class can’t define them both with the same method, one of them has to be defined by default will be private. I hadn’t ever heard of that before, and It was nice how in depth the podcast went on about that.      Overall, another really good podcast. The setup of CodingBlocks just makes it very user friendly, and I am able to understand what they are saying without getting too lost. With each podcast I listen to, I feel a little bit more confident in my computer science grammar knowledge and just feel more prepared for when I do have to write more complex code. 

From the blog mrogers4836 by mrogers4836 and used with permission of the author. All other rights reserved by the author.

9/25/2017 — Blog Assignment 2 — CS 343

https://sandit27.wordpress.com/2008/03/24/what-are-anti-patterns/
This week’s post focuses on Anti-patterns. Patterns defines a common solution to a problem that occurs through different settings. It is a general solution that can be specialized for a given context. In software design, it helps to capture the best practices that can be reused and applied in the development of different types of software.
In CS, anti-patterns are repetitive practices that appears beneficial, but will most likely result in bad consequences that will outweigh the advantages. It is called anti-pattern because the use will produce negative implementations. Two key elements are used to distinguish an anti-pattern:
A repetitive pattern that appears beneficial but ultimately produces negative results that outweighs its advantages.
A refactored solution that has been documented, proven in practice, and repeatable.
Anti-patterns should be diagnosed early. The following are some of the classic Anti-Patterns:
Organizational anti-patterns:
The “I told you so” the ignored warning from an expert is justified.
Mushroom management is when employees are kept uninformed or misinformed.
Project management anti-patterns:
The smoke and mirrors shows how unimplemented functions will appear.
Finally, software bloat is for allowing successive versions of a system to demand more resources.
I chose this topic because I thought a blog post on anti-pattern of function as child component was interesting. The post can be found following this link, http://americanexpress.io/faccs-are-an-antipattern/. The article argued that Function as child component, FACC is an anti-pattern. FACC is a pattern that allows users to pass a render function to a component as child prop. It allows users to pass as children to a component/function.
FACC was argued to be an anti-pattern. The example was a summation function of 2 numbers and returns the result. Clean code practices recommends descriptive names for properties, variables, and functions. So, in this case the best practice is to name it as add or sum, but not children. The function passes render callback functions through a prop named children. The main issue here is that the FACC function uses the prop children to pass in render callbacks. This pattern goes against what is considered best practice, so it is an anti-pattern.
I chose this article because it introduces an anti-pattern in a reactjs function and reactjs articles are always an interesting read. It argues that naming props as children in the FACC function was not the best practice. It goes against what is considered to be the “Clean Code” standards. I thought that this article was worth a blog post because it was an interesting read.

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

9/25/2017 — Blog Assignment 2 – CS 443

Equivalence Class Testing
This week we turn to equivalence class testing. Equivalence class testing is a black box software testing technique that divides function variable ranges into classes/subsets that are disjoint. It is beneficial for two cases:
When exhaustive testing is required.
When there is a strong need to avoid redundancy.
Equivalence class testing selects test cases one element from each equivalence class. This helps to reduce redundancy.
There are 4 types of equivalence class testing:
Weak normal equivalence class testing: The term weak refers to single fault assumption. This is accomplished by using one variable from each equivalence class in the test case.
Strong normal equivalence class testing: The term strong refers to multiple fault assumption. This method uses test cases from each element of the cartesian product of the equivalence classes. The cartesian product guarantees the notion of completeness in that all of the equivalent classes are covered and there is one of each possible combination of inputs.
Weak robust equivalence class testing: This term combines weak with robust, meaning single fault assumption with invalid values.
Strong robust equivalence class testing: This term combines strong with robust, meaning multiple fault assumption with invalid values. The test cases are the cartesian product of all the equivalence classes.
This article talks about redundancy in equivalence class testing. It introduces the following problem: Suppose a there is a UI for creating user accounts. The Username is between 1 and 25 characters, spaces are not allowed. The gender can be Male or Female. It would be impossible to test all combinations of inputs instead we turn to equivalence class testing.

Breaking the conditions down EC reduces the test cases into 5 equivalence classes.

Field
Description
3. User Name
Empty
4. User Name
Length > 25 (no spaces)
5. User Name
Length > 25 (containing a space)
6. User Name
Length >1 and = with >.

I chose this post for its simplicity and example of the UI for creating user accounts. The example helps to connect the concept of EC to test cases that can be validated. So, it helps to break down the problem into different ECs and its product into different test cases. It also demonstrates the advantages of EC in helping to reduce redundancy and test time. I chose this post because it gives a good example of EC testing.

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

Anti Patterns that can be the Death of a Project

A course named “Software Construction, Design, and Architecture” can certainly hit upon an endless number of topics. Due to this problem, I referred to concept map Prof. Wurst created at the beginning of the semester. Of the various topics to choose from I ended up going with anti-patterns for this week. I’ve found learning what not to do can sometimes be more useful than learning what to do. A lot of times you can infer what to do by simply being told what not do to. In a nutshell, anti patters are common patterns that occur that are known to cause problems and make life more difficult. So, I stumbled upon a blog post written by Emile Swarts in which he discusses some of the most common anti patters he has seen. I found Emile’s thoughts to be quite useful and relatable and I will be sure to factor in these common situations when developing software.

Emile discusses five of them: accidental complexity, dependency hell, catch me if you can (he made up the name for this one), blind faith, and abstractions of deceit. With the experience I have gained from my internship, accidental complexity, blind faith, and dependency hell are the three that stood out the most to me and have encountered personally. I find people are very good at making things more complicated than it needs to be under any circumstances, not just software. Complexity is often the root of all problems and can ruin projects. If it works it should probably be left alone. The biggest thing I took from what he wrote about this is that accidental complexity can basically be blanket over all anti patterns. Don’t reinvent the wheel if you don’t have to. Work with what is already given to you. The next anti-pattern I mentioned I liked was dependencies. Dependencies break things and make things more complicated. In an ideal world each piece of software and everything each piece software does would be totally non-reliant on anything else. Obviously that won’t be happening anytime soon, but I feel it something all developers should strive for. I always think of operating system specific software as an annoying overarching dependency. Granted this often on purpose, but the point is it certainly would be easier if different software wasn’t needed for different operating systems. Blind faith is the last one I wanted to discuss. He brings up valid points on how damaging an update or new piece of software can be if it doesn’t work correctly. Depending on the size of the operation, it could cost companies thousands of dollars each minute the software is still broken. This is why no one should ever assume something works. No matter how confident you are, test it, and if it works, test it again. You don’t want your software to be source of a major problem.

Link:

https://www.madetech.com/blog/5-software-anti-patterns-i-love-to-hate

 

From the blog CS@Worcester – README by Matthew Foley and used with permission of the author. All other rights reserved by the author.