Our firsts tests

For this week our job was to learn to use the selected tools for testing. Carlos did a little bit of research for testing in Go, it’s going to be useful for the back-end. Jesus learned how to use Espresso to test android UI. Adler installed some tools from the NightmareJS for the front end and me, José, did a tutorial to install and use Junit4 for Java. Unfortunately, the project changed focus and we are not going to develop an Android app, so Java and Espresso are not going to be useful anymore. We are going to be developing only a web app. The good news is that we are already prepared with the research that Carlos and Adler did. Next week we hope to be installing and using demo tests in the repository of the project and perhaps do all the essential starting configuration.

Our code for junit is available on our GitHub here.

Planning week 3

This week we are going to do a little bit more of research on the selected frameworks and tools we decide, as we stated on the semester plan. For this project we decided that we are going to use mostly Java for Android, SOLID for the database and Go for the back-end. Each one of us is going to learn through tutorials and guides a specific tool for testing and at the end of the week we are going to write down the conclusions in another post. For this week the assignments are:

Carlos Alberto Rueda: Do research of a Go testing tool, pick one and learn to use it.

Jesus Alberto Alvarez: Learn to use Espresso for testing Android UI.

José Carlos Peñuelas: Learn to use JUnit for automated Java tests.

Adler Zamora: Learn to install and use NightmareJS for several front-end tests.

It’s important to say that this doesn’t mean that this is not what each one if use is going to work on the whole semester. We just want to learn a little bit about setting up the tools and add them to our project from the beginning in case that we need them. Some things might(will) change or some tools are not going to be needed. Also, we should be able to explain how to explain the usage of a testing tool to our partners so that they can write tests too. The point of this is that whenever we need more work on one part of the project we could help others to test on any framework we use.

Project description

The project we are going to be working this semester is about smart cities. The objective is to build a platform that collect data around a specific city using tools like ArcGIS and ReactJS. The platform will also create tours of the city using the data and analysis and then guide the user trough the city using the GPS localization of the user’s phone. We need to be able to create, update and delete walk registers of the users and for that we may need a database to save all those registers, we are not sure if that is a requirement for the project but we will take it into consideration for the research that will be described in the next paragraph.

Mostly the languages that we are going to be working with are JavaScript and Java and some tools are the already mentioned ReactJS, ArcGIS and probably NodeJS. We are still not sure if we will need an SQL or no-SQL database but it would be good to know frameworks or tools for integration testing. With that information our team looked for some testing frameworks that will allow us to make testing easier for us in every aspect of the development:

Espresso:
Espresso is a powerful tool for testing purposes for android. Made by google it allows for testing of android applications by simulating app interaction in your test cases. It even allows to test interactions between your app and others. By using assertions and telling espresso where to click and what to input it allows app flow testing and general responses.

JUnit:
For unit testing, as android is mainly done with Java, JUnit should be the go to tool for being able to test the code and have easy test automation. It is easy to implement and helps to develop by TDD.

Mocha:
Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases.

Since we will be using ReactJS for our project as the frontEnd framework, we need to really take in consideration the different tools we could integrate and use for its proper end-to-end testing. The ideal scheme is for users to constantly be using our system, so the most we focus on developing a high quality software, the best product will give to our customers.
We did a research and found out that we could start with diferent tools depending on the most accurate aproach.

NightmareJS:
NightmareJS is a high-level automation library wich has:
Niffy which detect UI changes and bus across releases of your web app, Daydream which is a chrome extension to record your actions into a puppeter script & Electron which helps you generate a cross-platform desktop app using html, css, js.

Enzyme:
Enzyme is a tool that goes great with Mocha. It is a JS testing utility for React that makes it easier to assert, manipulate and traverse a React Components’ output. It is said to be easy to learn (both Mocha and Enzyme) even for new users in a short period of time.

Protactor:
In class we talked about the goals on testing and mentioned Verification and Validation. Well, there is this tool called Protactor, which is for acceptance testing which means that a system is being tested to evaluate the compliance with the business requirements (or the validation stage). The bad thing about it is that it was originally designed for Angular, although it is possible to configure it to work with React. It also helps you testing your app against a wide variety of software.

Mongo-Orchestation:
We are still not sure what kind of database we are going to use for the project, but if we had to guess, we are probably going to need a no-SQL database because the data we will manipulate may be big or unstructured.  MongoDB is a database program that is based on documents, it is said that it’s easy to use and to set up in almost any project. To do testing easily in a MongoDB database there is Mongo Orchestation. Mongo Orchestration (MO) is an HTTP server providing a RESTful interface to MongoDB process management running on the same machine. This will help us to automate test for simple requests using mocked server responses.

Semester plan

This semester is going to last 14 weeks, and for watch one we have activities to be done and requirements to fulfill to make our project. We are going to be doing the testing part of an already existing project of another class from one of my partners. The product is probably a web application o our planning must try to cover everything from building the environment and testing the final product. Of course, this plan is probably going to fail as we don’t know very much about the requirements or tools we are going to use. However, it’s always good to have some idea of what we should be doing in each week. The plan for each week is the next one:

Week 1: Research for development and testing tools.
Week 2: Decide for the tools we are going to use and learn to use them.
Week 3: Develop the base of the project and have functional automated tests.
Week 4 and 6: Back-end configurations and testing connectivity.
Week 7 and 9: Initial tests for general features and work on them.
Week 10 and 11: Continue on the development of features.
Week 12 and 14: Requirements verification and validate the final product.

During this week we want to do some research for the tools that are available for coding and testing with more efficiency. We are going to write a document that has all our research by Saturday, this will help us to take a decision for the next week and start learning how to use the tools we choose. Our goal for this class with this project is to learn to implement the best practices for testing, we are going to try to have automated unit testing and integration testing.