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

Unleash the power of ChatGPT in your C# applications with NGpt - C# OpenAI GPT client

Meet NGpt - OpenAI GPT C# client library that will make your conversations with ChatGPT a breeze! Have you ever been struggling building your own smart AI application in C#? Well, now you can use ChatGpt inside your application! Introducing NGpt, the powerful .NET library that lets you integrate ChatGPT seamlessly into your C# applications. No more nigts spent on building your own AI solitions, no more convoluted logic and building complex business rules - just pure AI bliss. In this blog post, we'll dive into the wonderful world of NGpt and show you how easy it is to use. You might even find a few laughs along the way. The Magic of NGpt NGpt is a transient fault-tolerant .NET 6 OpenAI client that simplifies ChatGPT integration for C# developers. It's like your friendly neighborhood Spider-Man - always there to help you out when you need it most. With just your OpenAI API key, you can start coding AI applications in C# faster than you can say "Peter Parker." Let...

Specflow czyli BDD w praktyce

Dzisiaj pokażę w praktyce w jaki sposób zbieram wymagania korzystając z narzędzia Specflow. Na początku przypomnę nasze historie użtkownika. Potem skonfigurujemy dodatek Specflow Visual Studio. Na końcu pokażę jak wygląda język Gherkin i zaimplementujemy pierwszą historię użytkownika US1. Oto lista funkcjonalności, które będę implementował w aplikacji Perfect Life: US1: Jako użytkownik aplikacji mobilnej chcę ekran logowania aby mieć możliwość zapisywania swoich postępów US2: Jako użytkownik aplikacji mobilnej chcę mieć kalkulator wskaźnika BMI aby móc mierzyć poziom swojej kondycji US3: Jako użytkownik aplikacji mobilnej chcę widzieć wykresy aby móc wizualnie interpretować swoje postępy US4: Jako użytkownik aplikacji mobilnej chcę mieć możliwość rozwiązania quizu, żeby zbadać wskaźnik Body Age US5: Jako użytkownik aplikacji mobilnej chcę pobierać pliki PDF aby mieć dostęp do planów dietetycznych US6: Jako administrator aplikacji chcę zapisywać dane telemetryczne aby móc an...

Running Microsoft SQL Server on Linux with Docker

Probably you heard that Microsoft Sql Server can only run on Windows machines. Good news - This is not true anymore. You can easily install it on Linux machine too. In this article I show you 2 ways of installing Sql Server on Ubuntu 16 and demonstrate how to connect to the database from remote machine. OPTION 1: Slow way - Manual installation This is the most straightforward way of installing. You download packages and configure Sql Server interactively(you set password, port and choosing installation option - free or paid). This is the step by step instruction from microsoft https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu OPTION 2: Fast way - Running on docker with just 2 pure-command-line commands. My assumption is that your Ubuntu machine has already docker installed. You can check if Docker is already installed by tunning the command: docker. If you don't have docker installed, no problem: before continuing below instruction just install...