Open In App

Stress Testing in CppFastOlypmicCoding plugin in Sublime Text

Stress Testing is a software testing technique that determines the robustness of software by testing beyond the limits of normal operation. Stress Testing is useful when anyone needs to find out corner test cases for problems, which work on the sample test case but get WA (wrong answer) on submission. 

Sublime Text along with Cpp​Fast​Olympic​Coding plugin provides a lot of features to ease up and expedite the process of writing and testing code for competitive programmers. Stress Testing is also one of the useful features of this plugin.



Before proceeding further with the article make sure to install the MinGW compiler and change environment variables

Install the latest version of Sublime Text from https://www.sublimetext.com/. 



Must Read – Setting up Sublime Text For Competitive Programming (C++) Using Fast Olympic Coding Plugin

Setting up Sublime Text and CppFastOlymicCoding plugin

Step 1: In Sublime Text open the command pallet by navigating to Tools -> Command Palette or using key binding Ctrl+Shift+B.

 

Step 2: Type Install package control to install package controller for sublime text. The package controller helps in downloading different packages for sublime text. 

 

 

Step 3: Type Package Control: Install Package in command pallet and search for C++ & C Single File Builder – Minghang Yang package.

 

 

Step 4: After installing select the Build System as C++ Builder Minghang Yang.

 

Step 5: Now you can run a C++ program using the command Ctrl+B.

 

Step 6: Type Package Control: Install Package in the command pallet and search and install Cpp​Fast​Olympic​Coding by Jatana.

 

How to use the Stress Testing Feature?

Step 1: For using the Stress Testing feature you need to create three files in the same director namely 

 





// file name format <name>.cpp  Ex: test.cpp
// This program takes input of a number and if number is
// less than 50 then prints it
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    if (n < 50)
        cout << n;
    return 0;
}




// file name format <name>__Good.cpp Ex: test__Good.cpp
// this program takes input of number and then prints the
// same number
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    cout << n;
    return 0;
}




// file name format <name>__Generator.cpp Ex:
// test__Generator.cpp this program generates a number
// between range 1 to 100
#include <bits/stdc++.h>
using namespace std;
int main()
{
    srand(time(0)); // seeding the rand with system time
    cout << rand() % 100 + 1; // printing number between
                              // range 1 to 100
    return 0;
}

Step 2: Navigate to the <name>.cpp file (Ex: test.cpp); Open the Command palette and type Make Stress or FastOlympicCoding: Make Stress then press enter. 

 

Step 3: To stop Stress Testing open Command Palette and type Stop Stress or FastOlympicCoding: Stop Stress then press enter. 


Article Tags :