Coder Social home page Coder Social logo

minitalk_tester's Introduction

Minitalk Tester

The Minitalk Tester is a Python script designed to test the functionality of the Minitalk project from the 42 school. It automates the process of running various test cases to ensure that the server and client programs function correctly.

Features

  • Test basic functionality with different input strings
  • Test the ability to handle large input strings
  • Stress test the server-client exchange with multiple iterations
  • Test bonus functionality with Unicode characters

Prerequisites

Before using the Minitalk Tester, make sure you have the following:

  • The Minitalk server program compiled and ready to run
  • The Minitalk client program compiled and ready to run
  • Python 3 installed on your system

Usage

  1. Clone the Minitalk Tester repository to your Minitalk folder.
  2. Compile the Minitalk server and client programs.
  3. If needed, modify the PATH_TO_CLIENT and PATH_TO_CLIENT_BONUS variables in the script to point to the compiled client programs.
  4. Open a terminal and navigate to the directory where the Minitalk Tester script is located.
  5. Run the following command to install the required dependencies:
	pip install psutil click termcolor
  1. Run the Minitalk Tester script using the following command:
	python minitalk_tester.py [options]

The available options are:

  • -h, --help: Display the help message
  • -a, --test_all: Run all tests
  • -m, --test_mandatory: Run only the mandatory tests
  • -b, --test_bonus: Run only the bonus tests
  • -t1, --test_1: Run Test 1 (basic functionality with a 100 char)
  • -t2, --test_2: Run Test 2 (behavior when an empty string is passed)
  • -t3, --test_3: Run Test 3 (ability to handle a string of 20,000 char)
  • -t4, --test_4: Run Test 4 (stress test with multiple iterations of a 3,000 char)
  • -t5, --test_5: Run Test 5 (bonus functionality with 100 Unicode char)
  • -t6, --test_6: Run Test 6 (stress test with multiple iterations of a 4,000 Unicode char)
  1. The Minitalk Tester will execute the selected tests and display the results in the terminal.

Expected Output on the Server

  • Test 1: The server should receive a string of 100 characters 'A' from the client.
  • Test 2: The server should receive an empty string from the client.
  • Test 3: The server should receive a string of 20,000 characters 'Y' from the client.
  • Test 4: The server should receive multiple iterations of a string of 3,000 characters from the client. ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', j' 'k', 'l' 'm', 'o')
  • Test 5: The server should receive a string of 100 Unicode characters ๐ŸฆŠ from the client.
  • Test 6: The server should receive multiple iterations of a string of 4,000 Unicode characters from the client. ('๐ŸŒ‘', '๐ŸŒ’', '๐ŸŒ“', '๐ŸŒ”', '๐ŸŒ•', '๐ŸŒ–', '๐ŸŒ—', '๐ŸŒ˜', '๐ŸŒ™', '๐ŸŒš')

Make sure to compare the actual output on the server with the expected output to verify the correctness of the Minitalk implementation.

Important Note

  • Ensure that the Minitalk server program is compiled and running

before running the Minitalk Tester.

  • Make sure to modify the PATH_TO_CLIENT and PATH_TO_CLIENT_BONUS variables in the script to point to the correct client programs.
  • The Minitalk Tester script assumes that the server program is named "server" and the bonus server program is named "server_bonus". Modify the SERVER_NAME and SERVER_NAME_BONUS variables if your server programs have different names.

Troubleshooting

If you encounter any issues while running the tester, please check the following:

  • Make sure you have correctly installed and compiled the Minitalk server and client programs.
  • Ensure that the server is running before you execute the tester.

Contributing

Contributions to the Minitalk tester are always welcome! To contribute:

  1. Fork this repository.
  2. Create a new branch for your changes.
  3. Submit a pull request with your changes.

Thank you for considering to contribute to the Minitalk tester!

Feel free to contact me.

License

This project is licensed under the MIT License. See the LICENSE file for details.

minitalk_tester's People

Contributors

malwarepup 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.