Przejdź do głównej zawartości

Perfect Life app - test your software like google

As far as we talk about automated tests there are 3 levels of testing:
1. Unit tests
2. Integration tests
3. System tests
Google propose another test classification, but it can be mapped directly to the above 3 points. So google uses 3 following test levels:
1. Small test
2. Medium tests
3. Large tests

Google also defines how to keep the balance between test types. Here it is:
1. Small test - 70%
2. Medium tests - 20%
3. Large tests - 10%

Today I'll show you how in my Perfect Life application I'm doing integration tests.
In small project i think medium/integration test should play important role and I'd dedicate 50% of my tests to integration.

Let's jump into the code. This is a client class placed in Xamarin application, that is responsible for calling .NET Core web service:


This is a test for this class. Note it calls real web service:


So for small project to keep test balance I would follow the following proportion:
1. Small test - 45%
2. Medium tests - 50%
3. Large tests - 5% - also I would limit the large tests part to manual.

Dear reader, what is your ideal test proportion that you follow?

Komentarze

Popularne posty z tego bloga

Connect to Azure from command line on Windows

When working with Azure we could go two ways: 1) using Azure portal and work in UI from your web browser 2) Connect to Azure from command line and run commands by typing in text in CMD. I already wrote about option 1 but today I'll show you how to start with option 2 which is Command line. First we need to download MSI installer from Microsoft website After sucessfull instalation you're ready to test az command. Open CMD and type in 'az' Now let's log in with your Azure credentials. Just type in "az login" in cmd. You should be redirected from command line to web browser and prompted for username and account in web browser. When you confirm your identity you'll be presented the screen like this in command line:

Learning e24cloud.com API

Today I'll show you how to use API in order to create virtual server in the cloud directly from your code. We're going write a script in PHP language and use Amazon SDK API to connect with e24cloud.com, which is the biggest and most modern hosting provider in Poland. First we need to install Amazon SDK http://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/installation.html One important note: We can use the latest version of amazon SDK but we also need to do one trick. We'll use signatureV2 instead ov Signaturev4 as e24cloud doesn't support SitnatureV4 yet. You can download it here: https://github.com/aws/aws-sdk-php-v3-bridge We need to download SDK and the bridge which allows us to use Signaturev2 to the same folder, so that require instruction work seamlessly in the form that I provided in the example below. Then go to your admin panel in e24cloud.com to find two values: a key and a secret. In the following code you need to paste those 2 values. ...

Up and running with Laravel

Today I'll show you how to start working with Laravel - a modern PHP framework. After reading this article you'll be able to: - Install XAMPP - Configure Virtual Hosts on Apache - Create your first application in Laravel - Run the application - Start coding As a first step I encourage you to visit Laravel.com to get some background knowledge about Laravel. Laravel is a PHP framework which is build on top of the MVC pattern (MVC stands for Model View Controller). You can find general explanation of MVC design pattern with some code examples written in Java here . I assume that you've already installed XAMPP which has version for Linux, Windows and OS X. Personally I'm using Windows in this tutorial but on each operating system it should work similarly. You can get the installer of XAMPP from this page: https://www.apachefriends.org/pl/index.html. When installer prompts you which options you want to install, you need to select Apache and you are free to...