Project basicly find the test that fails some code.

Stress Test project

Overview

many and many times in competitve programming when you have a solution got WA(wrong answer) and you do not know why and can not see any problem with your code. Now, you have to do a stress test. Stress test is a simple idea that if you have a code getting WA(wrong answer) or you want to test it - let us call it "myCode file" - and have a code getting the right answer and never got WA(wrong answer) - let us call it "answer file" - you can simply give them random test cases to both of them and compare the output of each one to another. If the output of "myCode file" differs form "answer file" then you have a test fails "myCode file". This is the simple idea and what our project do. I made this project to help me test my code easily, specially I do competitive programming most of time.

How project works

project has 6 files:

  1. "myCode.cpp" where code you want to test should be in.
  2. "answer.cpp" where code generates the right answer should be in.
  3. "input.in" file where input will be generated in.
  4. "output.out" file where "myCode.cpp" will print its output in.
  5. "answer.out" file where "answer.cpp" will print its output in.
  6. "stressTest.cpp" file that control the whole stress test process.

briefly, in "stressTest.cpp" I make random function refrenced to time of runing file (to differ from time to time), build "myCode.cpp" and "answer.cpp" once, then for number of tests, the project will build random test and run the excuted files and compare the outputs. take care that project compare two outputs as string comparsion (case and space senstive). feel free if you want to take this project and update it.

Note: In the project there is an example of comparing to codes. "myCode.cpp" calculates sum of subarray by prefix sum technique, "answer.cpp" calculates the same by brute force. input is number of test cases in one line and size of array(maximum 100 number) in another line and the array(maximum number is billion) in another line and number of queries in another line and in each line two idices in array refers to the left index and right index you should print the sum of the segment between.

How to use project

All you have to do after downlad this project in your device is:

  1. set your code(code you want to test) in file "myCode.cpp".
  2. find and set code that generates the reference answer in file "answer.cpp".
  3. open "stressTest.cpp" file and do this:
    • set number of tests you want in "tc" variable in line 110. (put on your consideration the time that your machine will take to run the number of tests you put will fit)
    • write code to build only one random test case in function "buildTests" in line 27.
  4. then run "stressTest.cpp" file in the usual way and you will get to each test:
    • "AC" refers to Accepted (two codes have the same output).
    • "failed in test i" and "WA in line j" and the expected output and your wrong output.
    • "failed in test i" and "files has no equal sizes" means that two codes does not output the same size of output.

PLZ: make sure you have read how project works section above.
Note: if "myCode.cpp" file failed in a test, the program will stop and you can see the test in "input.in" file and the output in "output.out" and the answer in "answer.out".
Note: there are some functions like "buildHugeNumber" in line 15 in "stressTest.cpp" file, help to build huge random number of n digit.
also "randll" in line 23 in "stressTest.cpp" file, help to get random long long.

Similar Resources

Network utility tool which enables to prototype or test network things.

netsck netsck is a network utility tool which is developed to prototype or test network things. It provides a shell inside which runs javascript engin

May 29, 2022

Upp11 - C++11 lightweight single header unit test framework

upp11 Lightweight C++11 single header unit test framework To use framework: Copy upp11.h in you project dir. Create unit test source files or modify e

Apr 4, 2019

📝 One of the difficult unit tester for ft_containers project

📝 One of the difficult unit tester for ft_containers project

ft_containers-unit-test About ft containers unit test is a complete testing for project of school 21/ecole 42 and allowing you test your containers: V

Oct 1, 2022

A simple, cross-platform, and continuously integrated C++14 project template

Project Name A simple, cross-platform, and continuously integrated C++14 project template. Making cross platform C++ projects is widely known to be a

Jul 27, 2022

GCC/gcov code coverage data extraction from the actual embedded system, without requiring a file system, or an operating system, or standard C libraries.

GCC/gcov code coverage data extraction from the actual embedded system, without requiring a file system, or an operating system, or standard C libraries.

Sep 16, 2022

Find patterns of vulnerabilities on Windows in order to find 0-day and write exploits of 1-days. We use Microsoft security updates in order to find the patterns.

Find patterns of vulnerabilities on Windows in order to find 0-day and write exploits of 1-days. We use Microsoft security updates in order to find the patterns.

Back 2 the Future Find patterns of vulnerabilities on Windows in order to find 0-day and write exploits of 1-days. We use Microsoft security updates i

Sep 6, 2022

✔️The smallest header-only GUI library(4 KLOC) for all platforms

✔️The smallest header-only GUI library(4 KLOC) for all platforms

Welcome to GUI-lite The smallest header-only GUI library (4 KLOC) for all platforms. 中文 Lightweight ✂️ Small: 4,000+ lines of C++ code, zero dependenc

Oct 2, 2022

ClickLock which supports old games where the Windows ClickLock fails to work. This is a charity project, designed for people with disabilities.

Mouse ClickLock For Games This small utility works in a similar way as ClickLock available on Windows, but also supports old games where the normal Cl

Jul 31, 2022

This is the 3th project of the Ecóle 42, in this project we will recreate the printf with some flags and some convertions!

This is the 3th project of the Ecóle 42, in this project we will recreate the printf with some flags and some convertions!

ft_printf of 42. Make with ❤︎ for Luiz Cezario 🚀 Introduction to ft_printf This is the third project in the 42 Cadet Curriculum. This project is pret

Aug 19, 2022

Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.

🔖 Index What is Libft? List of Functions Technologies ✨ What is Libft? Libft is an individual project at 42 that requires us to re-create some standa

Jan 17, 2022

Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.

Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.

Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.

Apr 5, 2022

TestFrame - This is a test framework that uses Raylib and ImGui together to help test and develop concepts

TestFrame - This is a test framework that uses Raylib and ImGui together to help test and develop concepts

This is a test framework that uses Raylib and ImGui together to help test and develop concepts. It is made using C++ because it uses classes for windows and views.

May 13, 2022

This is a C project, to find the weekly salary of your employees.

Weekly-Salary This is a C project, to find the weekly salary of your employees. This is a very simle project. At 1st you insert the code of the employ

Dec 3, 2021

In this repository you'll find the fully reversed source code for GTA III (master branch) and GTA VC (miami branch).

In this repository you'll find the fully reversed source code for GTA III (master branch) and GTA VC (miami branch).

Intro In this repository you'll find the fully reversed source code for GTA III (master branch) and GTA VC (miami branch). It has been tested and work

Nov 11, 2021

Tool that generates unit test by C/C++ source code, trying to reach all branches and maximize code coverage

What is UTBotCpp? UTBotCpp generates test cases by code, trying to cover maximum statements and execution paths. We treat source code as source of tru

Sep 30, 2022

42 Cursus - Libft: My implementation of some useful C functions and some additional ones to use it in future projects of 42.

42 Cursus - libft Info My implementation of some useful C functions and some additional ones to use it in future projects of 42. Status: still updatin

Jul 21, 2022

Hydrogen is a tiny GDI Malware, with some bytebeat music, many payloads and some shaders

Hydrogen is a tiny GDI Malware, with some bytebeat music, many payloads and some shaders

Hydrogen is a tiny GDI Malware, with some bytebeat music, many payloads and some shaders

Sep 24, 2022

Screens options data to find the best options to sell for theta-gangers

Robinhood-options-screener Screens options data to find the best options to sell for theta-gangers, works for cash-secured-puts and covered-calls. Get

Sep 6, 2022

A tool which profiles Vulkan devices to find their peak capacities

A synthetic benchmarking tool to measure peak capabilities of vulkan devices. It only measures the peak metrics that can be achieved using vector operations and does not represent a real-world use case.

Sep 9, 2022
Related tags
A tool which profiles Vulkan devices to find their peak capacities

A synthetic benchmarking tool to measure peak capabilities of vulkan devices. It only measures the peak metrics that can be achieved using vector operations and does not represent a real-world use case.

Sep 9, 2022
A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later (or C++03 on the Catch1.x branch)
A modern, C++-native, header-only, test framework for unit-tests, TDD and BDD - using C++11, C++14, C++17 and later (or C++03 on the Catch1.x branch)

Catch2 v3 is being developed! You are on the devel branch, where the next major version, v3, of Catch2 is being developed. As it is a significant rewo

Sep 26, 2022
A dynamic mock tool for C/C++ unit test on Linux&MacOS X86_64

lmock 接口 替换一个函数,修改机器指令,用新函数替换旧函数,支持全局函数(包括第三方和系统函数)、成员函数(包括静态和虚函数)

Sep 20, 2022
PlatformIO + BL602 Bouffalo Arduino Core Test
 PlatformIO + BL602 Bouffalo Arduino Core Test

PlatformIO + BL602 Bouffalo Arduino Core Test Description Uses A custom extension of the PlatformIO SiFive Platform (https://github.com/maxgerhardt/pl

Sep 8, 2022
A test showing a flipped bit in a file encrypted on two different machines

ChaCha ASM Test I have observed that the ChaCha cipher may have very rarely divergent code paths for AVX vs. SSE. I have seen this in earlier CryptoPP

Dec 6, 2021
A tool to test if a shared library is dlopen'ble

A tool to test if a shared library is dlopen'ble

Oct 17, 2021
End to end test framework designed for Juce applications

JUCE End to End test framework What is it? This package provides a mechanism to end-to-end test a JUCE application Prerequisites CMake. Must be 3.18 o

Sep 24, 2022
Various Framework to do Unit Test in C++
Various Framework to do Unit Test in C++

Unit Test in C++ There are many frameworks to performs unit test in C++, we will present the most popular ones and show how to use them. The testing f

Nov 18, 2021
An area to test reading in ATLAS xAOD format and writing out to Parquet

xaod_to_parquet An area to test reading in ATLAS xAOD format and writing out to Parquet Getting the Code Clone the repository with the --recursive fla

Nov 19, 2021
Handy C++ test framework

C++ Voyager Test Framework Voyager is a simple and handy C++ Unit Test framework. It is designed to be beautiful and expressive both. Try it to feel i

Mar 16, 2022