B8: Test Cases

https://qacomplete.com/resources/articles/test-scripts-test-cases-test-scenarios/

          I found a blog post this week that talked about Test Cases and the differences between Test cases and Test Scenarios. It starts by explaining Test Scripts and how they are the most detailed way to document testing. Test Scripts are usually a line to line description of actions within the code. It holds a lot of information on the software to relay data to the tester. It goes on to talk about how Test Cases are the second most detailed way of documenting testing work. Test Cases hold less information than Test Scripts because they only describe a specific function or idea to be tested. It allows more flexibility for the tester to find different inputs to test. It allows more detailed testing for testers that are familiar to the application for the program. The blog then introduces Test Scenarios that are known as the least detailed type of documentation. Test Scenarios hold a simple description of a function or intent a user might have when using the program. Like Test Cases, this allows more flexibility for the tester but also causes more areas that are likely to not be tested due to the undetermined scope of the problem.

          I chose this article because Test Cases were the most interesting subject when learning about the process of testing. I wanted to understand the difference between cases and scenarios which is what sparked my initial curiosity. I found that this blog was really interesting because it explains how testing can be structured based on the amount of information given. I enjoyed how the post explained the levels while also explaining how they benefit the tester through the expansive flexibility while also stating that this can lead to more grey areas of testing. I was able to grasp an understanding how these testing terms differ from each other and it expanded my visibility when looking at the testing process as a whole. The most interesting part of the blog post was the when it explained that testers can choose any of these terms to test programs depending on their knowledge of the product. This leads to the point where understanding the application of the product can also have great effects on how the tests are created. I found that there was a lack of diagrams within this post, but the information and definitions were easy to understand. I enjoyed this source very much as it easily explained the testing terms and how they differed from each other.

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

Implementing Laziness

http://matt.might.net/articles/implementing-laziness/

For this week’s blog I will be taking a look at an article on matt.might.net called ‘Understand and Implement Laziness with examples in Scala, JavaScript, Swift and Racket’. Within this article, Professor Might explains the concept of ‘laziness’ in programming. Laziness (other than the laziness we all initially think of) means delaying the computation of a value until the value is necessary. There are two interpretations of laziness, by-name and by-need. Using the by-name interpretation, the computation of the value is delayed until necessary and the computation is repeated each time it is used. Compared to by-need interpretation in which the computation of the value is delayed until necessary, and then the result is cached for subsequent users. The article explains how most languages we use today are strict languages, meaning they compute the value of an expression immediately. While other languages such as Haskell and Scala are lazy or can be called lazy if explicitly specified for a given situation of variables or parameters.

Scala, which is strict by default, can use the lazy keyword if explicitly specified. Therefore, it makes it easy to use as an example.

val x = { print (“foo”) ; 10 }

print (“bar”)

print (x)

As the article explains, this will print foo, then bar, then 10. But if we use the lazy keyword, we see that the output changes.

lazy val x = { print (“foo”) ; 10 }

print (“bar”)

print (x)

This will produce the result bar, then foo, then 10. The use of the lazy keyword delays the computation of x until it is actually needed.

Parameters can also be lazy. Some languages allow the definition of explicitly lazy parameters to functions. The parameters are not evaluated until they are used. In lazy languages like Haskell, the parameters are all implicitly by-need.

The use of lazy parameters and variables allow the programmer to save on computing space and loading time by holding off on the creation of complex objects and variables until needed.

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

Time for Testing

Michael Bolton’s post How Long Will the Testing Take? on his blog DevelopSense goes into depth on how long testing takes. Bolton claims good software testing as a process takes just as long as development, because the two are actually interwoven as processes and should happen simultaneously.

I think a lot of people brush off testing systems and software because of the idea that it takes additional time and can make the release of a project come later. However, as Bolton states, testing actually occurs simultaneously to development, as things are tested as they are implemented into the system to make sure they interact correctly. With this in mind, the program should be fully tested not long after it is completely developed. It doesn’t really cost much extra time, just the extra costs of developing tests. However, doing it this way also allows you to fix issues that come up along the way, before they become larger issues.

In some of my earlier programming classes, students were often encouraged to write one test and make sure it works before moving onto the next test. We were also encouraged to write tests after every method we made in our programs. In a way, we were clearly being prepared for this approach to development and testing, and it was clear even then why it is a good way to work on a program. It is logical, as incremental development seems a lot safer. You avoid getting overwhelmed with errors and issues that all compound on each other at once when you write your tests this way.

The blog post also covers the silliness of the question of how long testing will take. If your developers and testers are working together and doing what they’re supposed to, testing will finish as soon as development does. Although you can test the system in post-production, it is entirely optional, and is only done with good reason. So in the future, if I am ever managing the development of a system, I will be able to recognize what the testers are doing and ask more productive questions.

From the blog CS@Worcester – Let's Get TechNICKal by technickal4 and used with permission of the author. All other rights reserved by the author.

Use Case Diagrams

In the post Grouping Components by Use Case, Robert Annet discusses a strategy he uses when making context diagrams. After determining the use cases of his program, the components involved in each of the seven use cases are divided into groups within the diagram with different colored barriers. Structurizr, the web application Annet used for his diagrams, allowed him to filter the diagrams by the use cases. This makes observing which components are involved even easier visually.

The benefits of using this strategy of dividing your context diagrams into use cases is clear if you are working with a program that is complex enough to warrant it. A complex program in this case being one with a lot of different components which all are involved in several different interactions. If you have to make changes to a certain interaction withing your program, you can look at the components involved in the use cases and identify what you have to change to make the desired effect. Since your program has a lot of different and interlaced interactions and components, using these use cases and filtering your diagram into smaller parts makes it easier to understand the interactions and whats happening with the involved components without being overwhelmed by a ton of different components that don’t have any involvement. In my opinion, it is much clearer when you only have to see two or three components when you want to change an interaction in the program.

Using this strategy can also help you find other issues or reliances in your program. For instance, you may find that most or all of your use cases use the same component. Since this component is so integral to the interactions in your program, it is likely not one you are going to want to change much. This strategy also can help you find components that are not being used in your program, and thus may be unnecessary or you may need to reassess your use cases.

Overall, I thought Robert Annet’s idea of dividing programs into different use cases is very interesting and obviously useful as a concept, so I’m sure I’ll use in the future. Whenever you are dealing with a large enough system, you should consider looking at the diagram from this angle to see if you can identify any problems or vulnerabilities.

From the blog CS@Worcester – Let's Get TechNICKal by technickal4 and used with permission of the author. All other rights reserved by the author.

Testing With Mocking

For today’s blog I will be discussing the topic of testing with mocking. I recently read an article called “Mock? What, When, How?” by Lovis Moller. So let’s jump right in. What is mocking in terms of testing? Think about your code as a giant puzzle. All the pieces fit together, but they fit together in specific ways. Say you’re missing a piece of the puzzle because your partner hasn’t finished their part of the code yet. The new problem is this: how can I test my code without my partner’s piece of the puzzle? The answer is by using mocking. Mocking allows us to emulate or “mock” our partner’s puzzle piece that we are missing so that we can test our code without having to actually have the rest of the puzzle pieces. So mocking seems like a pretty good idea and like something we should use all the time, right? Wrong. The article talks about some of the pitfalls of mocking, which we will now talk about. First, the article says to mock only code you own. Do not mock third-party code simply because it’s not yours and you do not know how it works or how it should work. Another rule of thumb is to avoid mocking values and concrete classes. You should avoid mocking values because the objective of mocking is not to test for specific values, but rather it is meant to test the relationships and interactions between different classes (pieces of the puzzle). Concrete classes should not be mocked because of all the extras (methods, unused lines of code, etc) that come along with the  concrete class. It is more efficient to use mocking with an interface in this case.

In the past few weeks we have been doing testing with mocking in our CS class. I think it is a really neat and useful way to test because you can get stuff done on your end without having to wait for someone else to finish. In a world where we work as groups to complete projects, human error is always an issue. We could have our parts of the code done weeks before a deadline while our partner waits until the night before the deadline. Problem here is that we might not be able to proceed in testing and fixing our code because what our code does as a function relies on our partners code. We certainly do not want to wait until the night before a deadline to test and fix everything. Mocking helps us with this by emulating the code we are dependent on. I hope to use this more in the future.

Here’s the link to the blog: https://blog.codecentric.de/en/2018/03/mock-what-when-how/

 

From the blog CS@Worcester – The Average CS Student by Nathan Posterro and used with permission of the author. All other rights reserved by the author.

Live Monitoring and Testing

This article from softwaretestingmagezine.com talks about how testing and monitoring live and active services is a key element of software quality assurance. After deployment, making sure all of the bells and whistles of a service are up-to-date is a very important thing. Not only is it important on the programmer’s end, but it is extremely important on the client side because you should have a smooth experience for the both of you. Without proper testing of a product or service, it is impossible to correctly gauge how it will perform, which is why pre-launch and post-launch immanence testing is a must, especially today. This article then goes into many online services that monitor performance and uptime of certain services. Let’s go into some of these now.

A very important aspect to tracking a service is by recording it’s uptime. A service called “StatusCake” does just this. StatusCake is a paid monitoring service that can monitor page speeds had extremely high rates. They claim to have a very large system for monitoring big servers. Another nice thing about StatusCake is that it can set reminders about domain renewals. SSL monitoring, and much more. Although at may seem like monitoring uptime of your service wouldn’t make sense, it is actually very crucial in many ways. One thing I learned from this article about how important this is, is by monitoring your up time, depending on how long a service is kept online without failing, you can determine by logging where issues lay when something does occur. Something such a service outage or service lag can easily be tracked and tested if you have tools available to help you track it.

Tracking these issues with a system can be tricky, but there is another testing tool that can help us do exactly this. This tool is called Uptrends. Uptrends is another software testing tool that actually notifies you and double checks when something is wrong with your service. One of the harder things is tracking exactly when or where an error in a service occurs. The interesting thing about Uptrends is that it will actually give you detailed reports and statistics on these errors and also sends out email alerts when something goes wrong. This is another very important aspect of software quality assurance and testing. When something goes wrong you need to have information about the failure as fast as possible. With services such as this, you can receive notifications as soon as the fault happens so you can act accordingly to the issue.

Many services are available to help developers and clients for software testing and quality assurance. Depending on what you need, it is very important to keep a close eye on operations after a service is launched or completed, especially if it is being upgraded or modified in any way.

From the blog CS@Worcester – Amir Adelinia's Computer Science Blog by aadelinia1 and used with permission of the author. All other rights reserved by the author.

Backend Development

I am writing in response to the blog post at https://www.guru99.com/what-is-backend-developer.html titled “What is Backend Developer? Skills to become a Web Developer”. We have begun learning about backend development in the CS 343 Software Construction, Design and Architecture class by studying REST APIs using TypeScript and Angular JS. The blog post gives a general description of backend development and some career-related information like skillsets and average salaries.

Backend development is about defining the behavior and structure of a backend server and/or database. As opposed to the front-end, the backend is not visible to a visitor of a website or application or user of a service. One primary part of the backend may involve a database, where information is stored and retrieved to present to a user. The other primary component of a backend is the server, which is the machine that runs code and handles functionality. APIs are also part of backend development, which are interfaces designed for the purpose of enabling a front-end to communicate with the server.

A backend developer is an individual who creates and maintains the backend. The blog post goes into some detail about what a backend developer is generally expected to do, what their goal is, and also how much they tend to get paid. According to the blog post, back-end developers get paid more than front-end developers. Backend developers tend to the database, server and API for the purpose of supporting the front-end.

One particularly interesting distinction between a back-end and a front-end is that a back-end can be developed independently of a front-end, but a front-end cannot be developed independently of a back-end. It is possible to simply design a back-end for no intended application, and then afterwards build the application around the existing back-end service.

This article is a good summary of what backend development is about and what a backend developer does, and the difference between a front-end developer and a backend developer. Aside from the database management related components of backend development, the given description of backend development is consistent with what it is we are dealing with in class.

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

Domain Testing

I am writing in response to the blog post/tutorial at https://www.guru99.com/domain-testing.html titled “What is Domain Testing in Software Testing? (with Example)”. It goes into some detail describing what domain testing is, which is a topic that we have already seen in the CS 443 Software Quality Assurance and Testing class. Domain testing is a type of functional testing, which is a quality assurance process for testing whether the functionality of a system is behaving properly by verifying that certain inputs correspond to the specified outputs.

One thing about the blog post I am not quite certain about is that it refers to domain testing as an important “white box testing method”, which seems inaccurate; the act of checking inputs against expected outputs is independent from the software’s inner workings. Feeding the program an input and checking that the output is correct is a black box testing approach. The clarity provided by a white box would however be necessary in defining the specification itself, methods such as boundary value testing or equivalence class testing require equivalence classes and boundaries to be identified, which would require access to the inner machinations of the software.

Equivalence class testing and boundary value testing are a primary focus of the blog post. Equivalence class testing partitions the set of possible inputs into subsets of inputs that have the same behavior, and boundary value testing tests the behavior given inputs at the boundaries of equivalence classes. The boundary values are particularly useful inputs to test because they are edge cases that are more likely to produce incorrect results compared to arbitrary values chosen within the boundary. If there is an off-by-one logical error then testing the boundaries is what will make it apparent.

I think that this blog post is a good summary of some of the testing methods we have learned about in our classroom activities. It does not go into as much detail or cover more specific varieties of testing such as weak and strong or robust boundary value testing, but it is a short and simple introduction to what domain testing in software testing is about.

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

JAVA OOPS

Hey everyone, welcome back to phan’s cs where I discuss my recent 343 CS course related topics that I’m currently learning. Today I’m using Edureka blog about object-oriented programming for my resource which can be found on https://www.edureka.co/blog/object-oriented-programming/. Java OOPS concepts which stands for object-oriented programming is a programming style that includes concepts like class, abstraction, object etc. The core of oriented-oriented programming involves these four concepts inheritance, encapsulation, abstraction, and polymorphism. First, the concept of inheritance is where the properties of one class can be inherited by the other. A great analogy is a parent and child, where the child inherited properties from the parent. In programming, this would be called a parent class which is a super class and a child class which is known as a sub class a sub class. There are classified into 4 types single, multilevel, hierarchical, and hybrid. Second, encapsulation, this means to hide your data to prevent any modifications. This can be done by two ways, first, declare the variables of a class as private and constructing public setter and getter methods to get or change the variable. Next, abstraction which is basically hiding the details and providing the vital things. A good example cell phone that they provide in this blog is a cell phone which a user can make calls, take pictures, etc. and there’s a lot of code that runs in the background that the users doesn’t have to worry about. Finally, there is polymorphism, which many forms. This when you can have multiple implementations for an interface or method. All in all, object-oriented programming is a programming style which involves these four concepts inheritance, encapsulation, abstraction, and polymorphism. The reason why I choose this topic is because I wanted to review the main objective of OOPS. I think this article is very informative and provides many analogy and examples of the concepts which made it easier for me to understand the material. I agree with many of materials that it provides and think it was very accurate. After reading this blog, I think it change the way I work because I now have a better understanding of Java OOPS.

From the blog CS@Worcester – Phan's CS by phancs and used with permission of the author. All other rights reserved by the author.

Hey Siri, Google This

CS SERIES (8).pngImagine being several years into your role as a developer; you’ve had a long week, a big project to push tomorrow and suddenly… you’re stuck on something. And you’ve double-triple-quadruple checked to make sure everything is working by code review but you cannot put your finger on how it is not quite perfect. What’s wrong? Let’s find out.

This is the first course-related podcast I’ve listened to for a blog post and if this is one of the only podcasts you will listen to, I recommend this one.

Jonathan Cutrell started off the podcast by saying “If there’s one thing that makes developers self-conscious it’s probably their googling history–more specifically things that they google that they forgot how to do.”

People can talk about code for days but they do not talk about the toll of what a developer thinks of themself when they are stuck on a part of their code or need to rely on the internet for something. This honesty makes it easier for university students and entry-level developers to understand the pace they are learning at is their own and that not everyone is perfect at coding even after years of experience.

Something that changed the way I thought about this is how important it is to know the pattern or routine of a concept. Things Cutrell says great developers care about is how understanding patterns and principles transfers but not necessarily the actual code itself. “Great developers” focus on the overall concept instead of wasting time on the small details of a language.

Due to this thinking, I realized I never considered how a developer can be the best of the best in one language but if they had to convert it into another language, the translation would be a little different. The real life comparison to this would be if someone were speaking with broken English. This does not mean they are not smart in any way, it’s saying that they are focusing on the main idea instead of a small detail they are trying to get through. They use their time more efficiently by moving on to a big concept instead of worrying about the syntax that they can easily google.

Overall, I appreciate what this article brought up as I was expecting it to be about just googling things but it dug a little deeper and mentioned what a good developer should focus on.


Podcast Episode: https://spec.fm/podcasts/developer-tea/204292

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