Giter VIP home page Giter VIP logo

afshinm / trytouca Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trytouca/trytouca

0.0 1.0 0.0 52.67 MB

Open-source regression testing system that you can self-host.

Home Page: https://touca.io

License: Apache License 2.0

Shell 1.67% JavaScript 0.16% C++ 17.41% Python 8.50% Java 6.95% Kotlin 0.36% TypeScript 54.41% CSS 0.02% Makefile 0.05% HTML 8.58% CMake 1.00% Batchfile 0.09% Dockerfile 0.36% SCSS 0.45%

trytouca's Introduction

Touca

This week is Touca Launch Week! Check out our Launch page for upcoming blog-posts, webinars, conversations, and live-coding streams.

License Documentation Website Product Demo Community

Touca is an open-source regression testing solution, built for engineers.

  • Track regressions between different software versions
  • Understand how your software evolves in behavior and performance

Touca Server

Start for free

Server

Option 1: Self-host locally

You could locally self-host Touca Server by running the following command on a UNIX machine with at least 2GB of RAM, with Docker and Docker Compose installed.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/trytouca/trytouca/main/ops/install.sh)"

Option 2: Use our cloud instance

Or you could sign up on https://app.touca.io that with additional features suitable for large teams. We have a generous free-tier plan and use usage-based pricing for storage and service.

Sneak Peak

Touca offer SDKs in Python, C++, Java, and JavaScript.

C++ SDK Python SDK JavaScript SDK Java SDK

Let us imagine that we want to test a software workflow that reports whether a given number is prime.

def is_prime(number: int):
    for i in range(2, number):
        if number % i == 0:
            return False
    return 1 < number

We can use unit testing in which we hard-code a set of input numbers and list our expected return value for each input. In this example, the input and output of our code under test are a number and a boolean. If we were testing a video compression algorithm, they may have been video files. In that case:

  • Describing the expected output for a given video file would be difficult.
  • When we make changes to our compression algorithm, accurately reflecting those changes in our expected values would be time-consuming.
  • We would need a large number of input video files to gain confidence that our algorithm works correctly.

Touca makes it easier to continuously test workflows of any complexity and with any number of test cases.

import touca
from is_prime import is_prime

@touca.Workflow
def is_prime_test(testcase: str):
    touca.check("is_prime_output", is_prime(int(testcase)))

This is slightly different from a typical unit test:

  • Touca tests do not use expected values.
  • Touca tests do not hard-code input values.

With Touca, we can define how to run our code under test for any given test case. We can capture values of interesting variables and runtime of important functions to describe the behavior and performance of our workflow for that test case.

We can run Touca tests with any number of inputs from the command line:

touca config set api-key="<your_key>"
touca config set api-url="https://api.touca.io/@/tutorial"
touca test --revision=1.0 --testcase 19 51 97

Where TOUCA_API_KEY can be obtained from the Touca server at app.touca.io. This command produces the following output:


Touca Test Framework

Suite: is_prime_test/1.0

 1.  PASS   19    (0 ms)
 2.  PASS   51    (0 ms)
 3.  PASS   97    (0 ms)

Tests:      3 passed, 3 total
Time:       0.39 s

✨   Ran all test suites.

Now if we make changes to our workflow under test, we can rerun this test and rely on Touca to check if our changes affected the behavior or performance of our software.

Unlike integration tests, we are not bound to the output of our workflow. We can capture any number of data points and from anywhere within our code. This is specially useful if our workflow has multiple stages. We can capture the output of each stage without publicly exposing its API. When any stage changes behavior in a future version of our software, our captured data points will help find the root cause more easily.

Value Proposition

Touca is very effective in addressing common problems in the following situations:

  • When we need to test our workflow with a large number of inputs.
  • When the output of our workflow is too complex, or too difficult to describe in our unit tests.
  • When interesting information to check for regression is not exposed through the interface of our workflow.

The highlighted design features of Touca can help us test these workflows at any scale.

  • Decoupling our test input from our test logic, can help us manage our long list of inputs without modifying the test logic. Managing that list on a remote server accessible to all members of our team, can help us add notes to each test case, explain why they are needed and track how their performance changes over time.
  • Submitting our test results to a remote server, instead of storing them in files, can help us avoid the mundane tasks of managing and processing of those results. The Touca server retains test results and makes them accessible to all members of the team. It compares test results using their original data types and reports discovered differences in real-time to all interested members of our team. It allows us to audit how our software evolves over time and provides high-level information about our tests.

Documentation

If you are new to Touca, the best place to start is the Quickstart Guide on our documentation website.

Community

We hang on Discord. Come say hi! We love making new friends. If you need help, have any questions, or like to contribute or provide feedback, that's the best place to be.

License

This repository is released under the Apache-2.0 License. See LICENSE.

trytouca's People

Contributors

ghorbanzade avatar cthulhu-irl avatar rmarrcode avatar duncanspumpkin avatar arvandmoe avatar mapron avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.