This is a repository to collect JUnit Tests for GAD exercises at TUM in SS21

Overview

TUM_GAD_Tests_SS21

This is a repository to collect JUnit Tests for GAD exercises at TUM in SS21. These tests have been written by students for students and are not part of the official course.

Usage

To use the provided tests, first clone this repository. Then, you have to create a symlink to your src folder to make it work with your IDE (see below). After that you just have to include JUnit in your project and you're good to go. To include JUnit you will just need to Alt+Enter on one of the red underlined @Test Annotation in the test file. Your IDE will show you options to include the correct JAR.

Windows

This has to be executed in the command line, run as administrator:

$ mklink /J \path\to\src\tests \path\to\repository\tests

Linux/MacOS

$ ln -s /path/to/repository/tests /path/to/src/

Structure of the tests

For every exercise that has tests, there will be a separate folder. The gad in the package name of the excercise file will be replaced by tests. So, if the classes of the excercises are located in the package gad.binarysearch (for the class gad.binarysearch.BinSea), the tests will be located at tests.binarysearch. Usually, the naming convention for test classes is to use the tested class name and append Tester (e.g. BinSeaTester) or another fitting name ending with Tester. Further information can be found in the contributing guidelines, too.

Collaboration

We will probably only add test cases from the problem statements and ones from issues we were experiencing. If you have cases yourself or spot mistakes we did in the tests here, feel free to open an issue or to create a pull request. Check out the contributing guidelines for further information. In case you are unsure how to create a pull request, take a look at the GitHub documentation. Please use JUnit 5.7 when writing your own Tests. Existing tests will be modified accordingly.

License

This project is licensed under GPLv3, see LICENSE.

Comments
  • Added tests for BinomialTreeNode and BinomialHeap

    Added tests for BinomialTreeNode and BinomialHeap

    Shortly describe your proposed changes:

    • All the tests for Binomial Tree Node
    • All the tests for insertions of BinomialHeap

    Link any issues if they have led to changes in the request:

    • None

    Note the (sub-)exercises the tests are meant for:

    • GAD 08 - Binomial Heap

    The tests for deletions and exceptions follow shortly

    opened by babyygemperor 12
  • Allow multiple correct solutions for some checks of exercise 6 (Issue 44 fix)

    Allow multiple correct solutions for some checks of exercise 6 (Issue 44 fix)

    Shortly describe your proposed changes:

    • https://github.com/N0W0RK/TUM_GAD_Tests_SS21/pull/45#pullrequestreview-676780843

    Link any issues if they have led to changes in the request:

    • https://github.com/N0W0RK/TUM_GAD_Tests_SS21/issues/44

    Note the (sub-)exercises the tests are meant for:

    • GAD 06 - Verbessertes Sortieren
    opened by babyygemperor 11
  • Create a generalized helper class

    Create a generalized helper class

    The idea is to build a helper class that eases the creation of large tests with simmilar inputs. This issue tries to resolve the codestyle limitations discussed in #47

    Goals:

    • [x] Test symlink copatibility across systems.
    • [ ] Offload Test Inputs and Outputs into structured text (e.g. JSON, XML, etc.).
    • [ ] Create a general tester class that can be used for every exercise.
    enhancement question wontfix 
    opened by N0W0RK 9
  • Lots of different non-functional cleanups and improvements

    Lots of different non-functional cleanups and improvements

    Note that this should be merged after the GPL license has been accepted (issue #15, pull request #19)!

    Changes introduced during this "clean-up" are:

    • A rewritten README file with a improved structure, proper relative hyperlinks, a better description of the repository structure and simplified textual layout
    • An updated CONTRIBUTING.md file that reflects changes in the README and minor grammar improvements
    • Moving the pull request template from docs into .github (because it has actually nothing to do with the project's documentation, if we had one)
    • Small extension to the issue template
    • Removed the .project file which is only useful for the Eclipse IDE
    • Edited the .gitignore file to include a bunch of other file types that should not find their way into this repository
    • Renamed other files in the dedicated directories if they didn't meet the structure description
    • Cleaned up the test environment of exercise 2 (a1de7b7d4f4dccde14c6402d7b3ecf89047c28af)
    • Cleaned up the test environment of exercise 3 (1aeb2706f2cdbe3a869cdf3867820442582c09dd)

    If anyone has something in mind, feel free to comment on those proposed changes here or on Zulip :)

    opened by CrsiX 8
  • Added DoublePivotFinderTests

    Added DoublePivotFinderTests

    Link any issues if they have led to changes in the request

    Please describe the (sub-)exercises the tests are meant for

    • GAD 6
    • Tests for DualPivotFinder.

    I had passed all tests on artemis and created some random cases with my implementation. I hope it works also fine with you. Make sure to run them on your computer before merging into main branch.

    opened by mertcorumlu 7
  • fixed all requests

    fixed all requests

    Shortly describe your proposed changes: Tests for BinomialHeap.java

    Link any issues if they have led to changes in the request:

    sorry for creating another pull request... one year into computer science and i still dont get git :/

    Note the (sub-)exercises the tests are meant for:

    • GAD 8 - Binomial Heap: BinomialHeap.java
    opened by maharajamihir 6
  • Added more tests for QuickSort and fixed an issue

    Added more tests for QuickSort and fixed an issue

    Link any issues if they have led to changes in the request
    https://github.com/N0W0RK/TUM_GAD_Tests_SS21/pull/28#discussion_r639720165

    Please describe the (sub-)exercises the tests are meant for

    • GAD 06 - Verbessertes Sortieren

    Added tests for QuickSort using all the pivot options without any selection sort based optimisation

    Would appreciate a review before I blindly merge it with main again

    opened by babyygemperor 6
  • Added all tests for Radixsort (incl edge cases)

    Added all tests for Radixsort (incl edge cases)

    Except for the final sort

    Shortly describe your proposed changes:

    • None

    Link any issues if they have led to changes in the request:

    • None

    Note the (sub-)exercises the tests are meant for:

    • GAD 07 - RadixSort
    opened by babyygemperor 5
  • DualPivotFinderTester fails for multiple possible pivots and undefined behaviour

    DualPivotFinderTester fails for multiple possible pivots and undefined behaviour

    Is your test request linked to a subexercise? Please describe: This is an issue with the dual MedianDistributed Pivot Tests

    Describe the behaviour you want:

    • Multiple possible pivots: When a value appears multiple times in the considered elements, the tests only allow for one of those elements to be returned as pivots.

      In this case for example:

      Considered Elements: [ -9, -28, 13, -28, -22]
      At indices           [  9,  14, 19,  24,  29]
      

      The pivots would be -28 and -9. The Test only accepts 24 as index for -28 but 14 would in my opinion also be correct.

    • Undefined behaviour According to artemis, results for arrays smaller then 5 only have to make sense. This implies that the indices have to be inside the given range. The tests however only permit certain values for range sizes smaller then 5 and notr just any values inside the range.

    bug 
    opened by N0W0RK 5
  • Add a CI pipeline to check for build errors and Java style guide violations

    Add a CI pipeline to check for build errors and Java style guide violations

    Considering EiST with their exercise point reductions for bad code style... I would suggest to add a CI pipeline (e.g. Travis CI) to accomplish the following goals on our test suite(s):

    • Prevent Java build errors
    • Point out bad practices to avoid them later on
    • Improve general coding style
    • Encourage other students to adapt the idea of testing their own projects in this or similar way as well

    After a quick search, there are some style guides around, e.g. this one from Google or this draft for OpenJDK (or this very old PDF document from Oracle?). From a quick point of overview, they seem to be quiet abstract but also consistent.

    But that's not of particular interest now. The questions are: Do we need it at all? What tools should be used (if we agree on that)? I'm open for further discussion. :)

    enhancement 
    opened by CrsiX 4
  • Linked tests of selection sort in SelectionsortTester.java

    Linked tests of selection sort in SelectionsortTester.java

    Link any issues if they have led to changes in the request

    Please describe the (sub-)exercises the tests are meant for

    • GAD 06 - Verbessertes Sortieren
    opened by babyygemperor 4
  • Code cleanup of some older exercises

    Code cleanup of some older exercises

    Shortly describe your proposed changes:

    Code cleanup of older tests, without functional changes

    Link any issues if they have led to changes in the request:

    #49

    Note the (sub-)exercises the tests are meant for:

    Any previous exercise(s), so everything below GAD 8.

    opened by CrsiX 0
  • Address code style issues in the existing code base

    Address code style issues in the existing code base

    Issue #38 has added a CI pipeline to check for Java style guide violations. However, the existing problems (look here) are not addressed yet. This issue aims to be a reference for everyone who wants to introduce fixes to the existing code base. Most of the problems may be fixed easily using an automatic linter, others may need manual edits.

    I would also like to add a status badge on the README like the example below:

    Java Style Checker

    But actually, even though we have lots of style violations the badge says 'passing' (at least currently). As that's not accurate yet, I won't add it yet.

    Code snippet for this particular badge:

    [![Java Style Checker](https://github.com/N0W0RK/TUM_GAD_Tests_SS21/actions/workflows/checkstyle.yml/badge.svg)](https://github.com/N0W0RK/TUM_GAD_Tests_SS21/actions/workflows/checkstyle.yml)
    
    good first issue 
    opened by CrsiX 0
  • Improve the setup description of the README file

    Improve the setup description of the README file

    For some users it might be obvious how to use our test suite, but others might have problems with it. For example, the Windows-specific setup description is just as short as:

    This has to be executed in the command line, run as administrator:

    $ mklink /J \path\to\src\tests \path\to\repository\tests
    

    Besides the fact that on Windows there are no paths that start with a "drive-less" \ but C:\ or D:\ instead, we need a much better and possible longer description for this. Of course, this would also apply to the *nix/BSD/MacOS part, which is just a ln call without further explanation.

    Parts of this issue may be tracked in certain Zulip threads as well.

    documentation 
    opened by CrsiX 1
Owner
null
Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

Testcontainers Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium we

null 6.7k Jan 9, 2023
CodeSheriff is a simple library that helps you in writing JUnit tests that check the quality of your code

CodeSheriff is a simple library that helps you in writing JUnit tests that check the quality of your code. For example, CodeSheriff may fail because you have methods in your code that have more than X lines of code, or that have complexity greater than Y.

Maurício Aniche 62 Feb 10, 2022
IntelliJ IDEA and JUnit: Writing, Finding, and Running Tests

IntelliJ IDEA and JUnit: Writing, Finding, and Running Tests ?? Webinar https://blog.jetbrains.com/idea/2021/11/live-stream-recording-intellij-idea-an

Christian Stein 11 Jul 23, 2022
Intercept network request by running Selenium tests with JUnit on LambdaTest cloud.

Run Selenium 4 Tests With JUnit On LambdaTest Blog ⋅ Docs ⋅ Learning Hub ⋅ Newsletter ⋅ Certifications ⋅ YouTube       Learn how to use JUnit framewor

null 11 Jul 11, 2022
Emulate geolocation by running Selenium tests with JUnit on LambdaTest cloud.

Run Selenium 4 Tests With JUnit On LambdaTest Blog ⋅ Docs ⋅ Learning Hub ⋅ Newsletter ⋅ Certifications ⋅ YouTube       Learn how to use JUnit framewor

null 11 Jul 11, 2022
Run Selenium 4 tests with JUnit on LambdaTest cloud.

Run Selenium 4 Tests With JUnit On LambdaTest Blog ⋅ Docs ⋅ Learning Hub ⋅ Newsletter ⋅ Certifications ⋅ YouTube       Learn how to use JUnit framewor

null 11 Jul 11, 2022
Check performance metrics by running Selenium 4 tests with JUnit on LambdaTest cloud.

Run Selenium 4 Tests With JUnit On LambdaTest Blog ⋅ Docs ⋅ Learning Hub ⋅ Newsletter ⋅ Certifications ⋅ YouTube       Learn how to use JUnit framewor

null 11 Jul 11, 2022
Clear browser cache by running Selenium tests with JUnit on LambdaTest cloud.

Run Selenium Tests With JUnit On LambdaTest (Browser Cache Clearing Example) Blog ⋅ Docs ⋅ Learning Hub ⋅ Newsletter ⋅ Certifications ⋅ YouTube      

null 16 Jul 11, 2022
This repository includes selenium tests examples using cucumber-jvm framework.

Cucumber Selenium Tests This repository includes cucumber selenium tests examples using wikipedia.org. Run tests To run tests on your local machine, y

Denys Vozniuk 3 Nov 27, 2022
Randomized Testing (Core JUnit Runner, ANT, Maven)

RANDOMIZED TESTING ================== JUnit test runner and plugins for running JUnit tests with pseudo-randomness. See the following for more infor

null 167 Dec 26, 2022
A TestNG like dataprovider runner for JUnit with many additional features

junit-dataprovider Have a look to this repositories Wiki pages for documenation, usage examples and further information. Table of contents Home What i

TNG Technology Consulting GmbH 237 Sep 7, 2022
JUnit 5 Parameterized Test Yaml Test Data Source

Yamaledt — JUnit 5 Parameterized Tests Using Yaml and Jamal Introduction and usage Note This is the latest development documentation. This is a SNAPSH

Peter Verhas 4 Mar 23, 2022
Exercicio envolvendo criação de Classe, Junit 5 e exception

ClasseData Complemente a classe Data desenvolvida anteriormente para que lance uma ExcecaoDataInvalida. Com esta única exceção, você deverá ser capaz

Mateus Samartini 3 May 7, 2021
Exercico com Junit 5, UML, Interação de classes e Exception

AcessoClube Exercico com Junit 5, UML, Interação de classes e Exception Exercicio: Projete e desenvolva um sistema de controle de acesso a um clube co

Mateus Samartini 3 May 3, 2021
A template for Spring Boot REST API tested with JUnit 5 and Cucumber 6

demo-bdd Un template Spring Boot pour lancer un BDD/ATDD avec Cucumber 6 et JUnit 5. Maven et le JDK 17 seront nécessaires. Exécuter les tests Le proj

Rui Lopes 4 Jul 19, 2022
Testes unitários em Java utilizando JUnit 5

Testes unitários em Java utilizando JUnit Este curso tem como objetivo habilitar o(a) aluno(a) a testar soluções desenvolvidas na linguagem Java, torn

Camila Cavalcante 3 Jan 18, 2022
Testes unitários em Java utilizando JUnit

Testes unitários em Java utilizando JUnit Este curso tem como objetivo habilitar o(a) aluno(a) a testar soluções desenvolvidas na linguagem Java, torn

Camila Cavalcante 6 Nov 8, 2022
JUnit 5 extension for easy-random

Easy Random/Faker JUnit 5 extension The simple, stupid random Java™ beans generator for JUnit 5 The easy random extension provides a test with randoml

Libing Chen 8 Nov 9, 2022
Override device mode by running Selenium test with JUnit on LambdaTest cloud.

Run Selenium 4 Tests With JUnit On LambdaTest Blog ⋅ Docs ⋅ Learning Hub ⋅ Newsletter ⋅ Certifications ⋅ YouTube       Learn how to use JUnit framewor

null 11 Jul 11, 2022