Object Oriented, what a paradigm, isn’t it? We use a lot more of classes and parts since everything makes an object here, let’s learn how is testing done here.
In object-oriented (OO) paradigm, software engineers identify and specify the objects and services provided by each object. In addition, interaction of any two objects and constraints on each identified object are also determined.
OO program should be tested at different levels to uncover all the errors. At the algorithmic level, each module (or method) of every class in the program should be tested in isolation.
At the class level, every class should be tested as an individual entity. At this level, programmers who are involved in the development of class conduct the testing.
Test cases can be drawn from requirements specifications, models, and the language used. In addition, structural testing methods such as boundary value analysis are extremely used. After performing the testing at class level, cluster level testing should be performed.
Test Cases in OO
The points that should be noted while developing test cases in an object-oriented environment are listed below.
It should be explicitly specified with each test case which class it should test.
Purpose of each test case should be mentioned.
External conditions that should exist while conducting a test should be clearly stated with each test case.
All the states of object that is to be tested should be specified.
Instructions to understand and conduct the test cases should be provided with each test case.
Scenario-based testing is used to detect errors that are caused due to incorrect specifications and improper interactions among various segments of the software.
Generally, the structure of a scenario includes the following points.
A condition under which the scenario runs.
A goal to achieve, which can also be a name of the scenario.
A set of steps of actions.
An end condition at which the goal is achieved.
A possible set of extensions written as scenario fragments.
Challenges
Encapsulation of attributes and methods in class may create obstacles while testing. As methods are invoked through the object of corresponding class, testing cannot be accomplished without object.
Inheritance and polymorphism also introduce problems that are not found in traditional software. Test cases designed for base class are not applicable to derived class always.
In software development there are some crucial elements in order to assure that we are doing what we need to solve the initial problem that made us start to begin with.
First of all, are we building the product right? This is what we need to ask ourselves when we think about Verification; every specification should be checked to be sure that our software is well developed, after we are certain that everything’s okay, we will start worrying about the other part: Validation.
Validation is the process of building the right product, while you may think that this process should be done before even starting, well… you may be right, but not quite, what about when we’re almost done with our product but it isn’t quite what the user needs, we should make this process of questioning in order to redefine or reorganice our development so, at the moment of the deployment, it meets the user needs as close as possible.
What happens if something does not go well? We have some concepts fo different kind of errors:
Fault – wrong or missing function in the code.
Failure – the manifestation of a fault during execution. The software was not effective. It does not do «what» it is supposed to do.
Malfunction – according to its specification the system does not meet its specified functionality. The software was not efficient, it was not usable, it was not reliable, etc. It does not do something «how» it is supposed to do it.
What about test cases?
A test case is a tool used in the process. Test cases may be prepared for software verification and software validation to determine if the product was built according to the requirements of the user. Other methods, such as reviews, may be used early in the life cycle to provide for software validation.
Uniform and minimum requirements for the format and content of software verification and validation (V&V) tasks and their required inputs and outputs that are to be included in SVVPs are provided for both critical and noncritical software. For critical software, specific minimum verification and validation (V&V) tasks and their required inputs and outputs that are to be included in SVVPs are defined.
This verification and validation (V&V) standard is a process standard that addresses all system, software, and hardware life cycle processes including the Agreement, Organizational Project-Enabling, Project, Technical, Software Implementation, Software Support, and Software Reuse process groups. This standard is compatible with all life cycle models (e.g., system, software, and hardware); however, not all life cycle models use all of the processes listed in this standard.
Verification and validation (V&V) processes are used to determine whether the development products of a given activity conform to the requirements of that activity and whether the product satisfies its intended use and user needs. V&V life cycle process requirements are specified for different integrity levels. The scope of V&V processes encompasses systems, software, and hardware, and it includes their interfaces. This standard applies to systems, software, and hardware being developed, maintained, or reused.
At the end as an abstract, we should be sure that our product is what we need and that it is working as needed, so everything turns out well, this can be tested via Validation & Verification, using tools as Test Cases and using IEEE Standards as our backbone.
Now, you have written your code, you know how to do mostly everything for you to have a great project, but of course, mistakes happen, let’s make sure you won’t leave one for your ‘FINAL_FINAL_OK’ version.
First of all, remember we’re not criticizing the author’s work, we do this in order to learn, to check that everything is okay and running as it should.
The next tip is to review the code with the developer, so he can explain certain parts if the code if you’re not certain of how it is working; please, ask questions, why does this class exist? How will the client need this? What does this method do? And a lot of more questions, really…
Define the scope of your revision, ask how much does the developer want for you to check, make sure you’re doing what you’re asked for.
Also, if you’re allowed, check a bit of the design, how the project works, how the classes are connected, why each one exists and keep asking yourself how would you do it yourself.
Finally make some constructive criticism about the project, tell the developer how would you improve the code, remember, code revision consists of checking everything in order to learn and getting better every time, working better as a team and making a better quality code.
First of all, wow, we have come far, don’t we? It’s been quite a long trip, with lots of things to do and learn, let’s take a ride around it.
Play this while reading, it may help us feel motivated as we go along:
Let’s start from the beginning of this period: UML diagrams.
We now know a lot about them, how to use them, their types, use cases, how they work and quite a bit more, can you recall? Help us decide how well you feel about this topic picking how spicy you think the subject is.
🌶️🌶️🌶️
Class Mapping, you know about it, don’t you? Check the article we wrote about it here.
Also we have something about code review and how to create it from classes in a UML diagram.
In case you need a bit of help with classes and coding, check this:
How was last week (Semana i)
Well, I really enjoyed it because I had a break from my usual responsibilities and work, I enrolled myself in a singing activity, which, if you don’t already know, is my biggest passion. Of course not everything is good, I got quite a bit sick and had to be in campus all day everyday because of my rehearsals, but hey, I really enjoy doing those things (not getting sick of course haha), so let’s take only the positive things from it.
It has been quite a good semester, let’s keep it like this the next month to feel satisfied of our work and enter our holiday season enjoying life.
Photo by Markus Spiske temporausch.com on Pexels.com
We learnt about UML, DB and more, but now, you want more!? Well code is the next step, let’s see a bit about it.
The simple steps are: looking at your model, check each method in it, usually its name tells us about its function, so if you can read it, you can guess what it does.
If you know how to code in any language, the rest should be easy, make some classes with its methods and each one should do what was stated in the UML diagram.
Now that you have each class, with its variables, methods and they’re working, well, you should just make sure that all of them connect with each other as you saw in your diagrams, also check that everything that has to do with your information in the DB is working.
There it is, as simple as that, you have the work done, see? Most of it relapses in a good planning and modeling. Keep it going, you’re getting better every step you take!
Databases are important for every project, so software isn’t an exception, DB help us create an space where we can keep all the information needed in the implementation of the project.
Now, we know how to plan a project, how to represent and model it, but if we want to create spaces for information that will help us later, how can we create them and translate them to tables in a DB?
First we need to take our classes in UML and determine the data we need for each one of them, once we know what we want, we will need to start asking questions about DB creation.
Use the preferred tools for DB and start creating tables for each class and make sure each one has the rows and columns for the information, also check the data types of every space in it.
Let’s talk about mapping now, what is it? Agiledata says «it is the act of determining how objects and their relationships are persisted in permanent data storage, in this case relational databases».
As we said before, when learning how to map objects to relational databases the place to start is with the data attributes of a class. An attribute will map to zero or more columns in a relational database.
Of course, as promised this topic is retaken, now we will get into more details, particularly about State Diagrams, Package Diagrams and Component Diagrams.
As previously seen, these diagrams work as a way of representing the different parts of a project and its relationships, let’s start talking about the first one, State Diagram.
According with GeeksforGeeks «a state diagram is used to represent the condition of the system or part of the system at finite instances of time.
It’s a behavioral diagram and it represents the behavior using finite state transitions.
Now let us talk about Package Diagrams, here’s a page with more information about it, a little summary follows:
Package diagram is a UML structure diagram which shows structure of the designed system at the level of packages, it shows the arrangement and organization of model elements in middle to large scale project. The following elements are typically drawn in a package diagram: package, packageable element, dependency, element import, package import, package merge.
Now, let’s look at the last one: «UML Component diagrams are used in modeling the physical aspects of object-oriented systems that are used for visualizing, specifying, and documenting component-based systems and also for constructing executable systems through forward and reverse engineering. Component diagrams are essentially class diagrams that focus on a system’s components that often used to model the static implementation view of a system». Visual Paradigm tells everything about this last kind of diagrams.
This concludes our entries about UML, we will keep creating content for your knowledge to keep growing. Thanks for following us until here.
UML, these initials stand for Unified Modeling Language, but what is it? According to Noel Ceta UML «is a modern approach to modeling and documenting software».
It is based on diagrammatic representations of software components. By using visual representations, we are able to better understand possible flaws or errors in software or business processes.
This model lets us understand in a better way how a project will be divided and how each part will be connected with the others.
There are different ways of representing it, they are organized into two distinct groups: structural diagrams and behavioral or interaction diagrams.
Structural UML diagrams
Class diagram
Package diagram
Object diagram
Component diagram
Composite structure diagram
Deployment diagram
Behavioral UML diagrams
Activity diagram
Sequence diagram
Use case diagram
State diagram
Communication diagram
Interaction overview diagram
Timing diagram
Here we can see a video of an example, related with the most common UML model: Class Diagram.
Other kind of diagram that is widely used is the Use Case Diagram, here’s an example:
According to SmartDraw «there are many different types of UML diagrams and each has a slightly different symbol set»:
Relationships between elements are important too, they’re represented as follows:
This topic is really extensive and we will discuss a little bit more about it in the next entry. Thanks for keeping up with us.
As usual we’re talking about software and systems, so we need to contextualize design into this concepts, what are Software Design Patterns? Well GeeksForGeeks says that «Design patterns are used to represent some of the best practices adapted by experienced object-oriented software developers. A design pattern systematically names, motivates, and explains a general design that addresses a recurring design problem in object-oriented systems».
There are more than one a few types of Design Patterns, we’ll see some in the next paragraphs:
Creational These design patterns are all about class instantiation or object creation. These patterns can be further categorized into Class-creational patterns and object-creational patterns. While class-creation patterns use inheritance effectively in the instantiation process, object-creation patterns use delegation effectively to get the job done.
Creational design patterns are the Factory Method, Abstract Factory, Builder, Singleton, Object Pool, and Prototype.
As people who often play games and are involved in the community, we have realized a situation that’s recurrent on the Internet. There’s no place where you can consult all available information regarding games: want to know the latest news on certain game or company? Better go to Twitter or to their official websites. Want to read reviews or opinions? Let’s go to a specialized page or maybe YouTube. Ratings? Another specialized page should do. Want specific information about certain game? Like number of users, downloads, developers or more? The best option is to look it up on the Internet or on their respective page in one of the many launchers there are now.
Another thing that happens often is that you may not recall what games you have played at some point or another. Many of us want to record everything we have ever played, whether it was enjoyable or not; we may even want to keep track of all the upcoming games we are waiting for. There already are platforms that keep a record of what you’ve played and have implemented a wishlist feature for games you want, but they often only work for the games they have available so, outside of that, the best option for a similar list is a classic notepad.
We want a site where all of the information above has been put together, where all we could possibly want to know about a video game is available in the same place. That’s why we have come up with this project, we intend to solve both issues at once. Our goal is to gather all kinds of people who, in some way or another, are related to the video game community and satisfy their needs as well. Here’s what we have established so far:
Team Name: VG lantes
Project Name: My Videogame List (final name pending)
General Description
My Videogame List is a website where people can share their interests in gaming. There is a large database of video games (old and new). Users can review their experiences with them and give them a rating that is public to everyone on the site. Ratings are averaged and this determines the popularity of the game (displayed onsite).
Each user has a personal profile which holds their “My Videogame List”. It contains titles (from the site’s database) that the user:
Is currently playing
Finished playing
Left on hold
Stopped playing
Plans to play
Users can specify if they recommend a game.
As a user you can follow other users so you can know about their interests (their videogame list is shared with you). You are notified with their recommendations.
When you log in, you get to see the main page (Home page) which shows you relevant information:
Page announcements (from administrators)
Most popular games of the season
Personal recommendations (based on your list’s most prevalent categories, followed users tendencies)
Upcoming games or downloadable content
News (plugins that pull tweets, blogposts, news, etc. from other sites relevant to gaming)
Another feature of the site are ‘communities’ which users can create. A community is basically a specialized forum, where users talk about certain things related to the community’s theme.
Communities can be public (anyone sees and enters freely), private (you know about the community’s existence and general information, but in order to be a member and see posts you have to request access) or secret (not visible at all, only accessible by invitation).
When visiting a game profile you can add it to your list.
Stakeholders
For them, we considered many aspects and perspectives a gaming community needs to be enriching. So, not only do game reviews and sharing interests works, but constant interaction between players is what truly makes video games stand out.
Important notice: Throughout this post (specially in this stakeholders section), we talk about users (and give them a perspective or a specific role in parentheses). This is because technically, for the site, they are the same kind of being: a person who registered and has an account. However, to describe some functionalities, it was important to define the role (or perspective taken by that user).
Carlos Ochoa (member of ITESM Guadalajara T-Games student group)
Coming with a strong interest and experience in video game tourneys, he shares the following use cases:
User (as tournament organizer) creates a ‘tourney’ (special community).
Actor: User (tournament organizer perspective)Basic flow: Creating a tourney means creating a special community that performs the basic functionalities of a regular community (posts and comments), but will also manage a bracket (a diagram showing who plays against who) and show updated results.
User (as tournament organizer) relates the tourney to a videogame in the database.
Actor: user (tournament organizer perspective)
Basic flow: In order for tourneys to be categorized, they need to be related to a specific game which is the one that will be played by participants.
Users (as participants) join the tourney.
Actor: User (any type of user perspective)Basic flow: Anyone registered on the MyVideogameList site can join a tourney (as long as it is public)
User (as tournament organizer) grants tourney administrator privileges to desired users.
User (tournament organizer perspective)Basic flow: Since results and brackets need to be updated, it is difficult for only one person to do it. The TO (tournament organizer) can give other users access so they can update the tourney’s information.
User (as tournament administrator) changes tournament privacy.
Actor: User (tournament administrator perspective)Basic flow: Some tourneys are meant for a select player base and will not be accessible to the general public to join (but they can spectate, which means that they see results in real-time but not participate).
User (as tournament administrator) sends private tourney invites to desired users.
Actor: User (tournament administrator perspective)Basic flow: For tourneys that are private, participants need to be invited. The tourney administrators can send invites with links for the selected players to join.
User (as tournament administrator) updates bracket scores.
Actor: User (tournament administrator perspective)Basic flow: Brackets are diagrams that highlight the progress of the tournament. Who plays vs. who, who advances, who loses, etc. This information is input by hand based on what happens at the tourney.
Users (any type of users) spectate tournament communities.
Actor: User (any type of user perspective)
Basic flow: All users can visit the tourney community and see results in real time.
On the topic of tourneys, Carlos also suggests a way of earning money through premium tournaments. Created only by a very select number of users (verification needed from site administrators), these require virtual currency (bought with real money, earned by winning tourneys or given for free to users in special events) to participate. The point here is to give something back to the page administrators.
Suggested use cases:
User (verified user) creates a ‘premium tourney’.
Actor: User (verified user perspective)Basic flow: Premium tourneys have the same functionalities as regular tourneys but require the user to be verified by the organization’s administrators. Also, a certain fee (site’s currency TBD) is required by participants to enter. These tourneys show more prestige than regular ones. Winners are actually rewarded (at least with in-site currency).
User (as participant) spends in-site currency to enter tourney.
Actor: User (any kind of user perspective)Basic flow: In-site currency is needed to enter premium tourneys.
User (as participant) is rewarded for winning a premium tourney.
Actor: User (any type of user perspective)Basic flow: The winner of a premium tourney is rewarded by the site (with in-site currency). Other type of rewards may be given based on the preference of the verified user who created the premium tourney.
Jose Guerra (Developer at Retro Studios and independent pico8 developer)
Has a lot of experience in the video game development environment, works for a company under Nintendo’s partnership and has tons of individual projects:
We asked him for help on this project via Twitter. So far he has expressed his willingness to work with us. We didn’t want to immediately bombard him with questions, so when we got his response we decided to wait until the next day (it was already kind of late) to actually explain what we need from him. We are currently waiting for his response after we explained what our project’s about and asked him for what he would like to be included as the developer he is.
Expected use cases from his part (not actually provided by him, but what we think he’ll say) include:
User (independent game developer) uploads their video game project.
Actor: User (verified user perspective)
Basic flow: An independent developer wants to have their games played by people interested in whether finding new workers, helping others out or simply having some fun. They get exposure and feedback.
User (game developer) creates a community regarding their new game.
Actor: User (game developer)
Basic flow: Developer wants to reach a larger audience, so he creates a special community in order to get more people interested in their new/upcoming game. It gives them a chance to gain recognition and interact with potential clients
User (game developer) fixes details about their game’s information.
Actor: User (game developer)
Basic flow: There’s some wrong detail included in a game’s page. Developer wants our website to fix this, so they notify the administrators when that happens.
User (verified game developer) asks for their game’s news to be included in the home page.
Actor: User (verified game developer)
Basic flow: A small company wants to have their information on our feed so more people get to know about them. They notify us about it and a process to get them featured starts.
User (independent game developer) updates his game.
Actor: User (independent game developer))
Basic flow: A game developer has received feedback and has since worked on improving their game. After finishing a new version or instance of their game they wish to update it without having to upload it in a completely new entry so people who have played are easily notified.
User (independent game developer) has his game included in a different ranking.
Actor: User (independent game developer)Basic flow: A developer thinks it’s unfair to have their indie game compared to the games of massive companies. They ask for their game to be considered for a different ranking system where only games in similar development contexts are compared to each other.
Ken Bauer (Moderator of a large World of Warcraft Group)
He has quite a lot of knowledge about different kind of blogs and forums, works as a professor inside Tec, loves to teach and help others, those are some traits that a good moderator should have.
Our approach to him was via email, he told us that he was interested in helping us. We couldn’t find an appointment soon enough to include his answers to our project delivery, but we’re planning on asking him for an interview next week so we can have his thoughts as soon as possible.
Expected use cases from his part (not actually provided by him, but what we think he’ll say) include:
User (Forum Moderator) can silence offensive users.
Actor: User (Forum Moderator)
Basic flow: If a user is being rude, the moderator wants to make sure he won’t do it again, so he has the ability to flag the users and silence or even ban them.
User (Forum Moderator) can censor offensive content.
Actor: User (Forum Moderator)
Basic flow: The moderator needs to go through a lot of content in the platform, but he needs to assure that there is no offensive content, so if he/she sees something, he can take it down.
User (Forum Moderator) can teach others how to make a good use of the platform.
Actor: User (Forum Moderator)Basic flow: As an arbitrator, this user should also teach others about the guidance and behavior inside the platform, so he may do some ruling by making some featured posts.
User (Forum Moderator) can make posts about the rules and supervise them.
Actor: User (Forum Moderator)
Basic flow: In the case that the rules are not working or being well followed, the Moderator could use his position to make changes and supervise them by making posts that should be picked as “Important”.