PGdP-Tests-WS21/22 is a student-created repository used to share code tests.

Overview

PGdP-Tests-WS21-22

PGdP-Tests-WS21/22 is a student-created repository used to share code tests.

Important Note:

In the near future, most exercises will contain test parts, like in W03H02. Therefore, this repository will only contain tests for the other parts.


"Legal status"

Es ist alles erlaubt, was die Lösung nicht verrät.

The so-called Übungsleitung will have an eye on this repository. But as long as the tests do not reveal the solution of the homework, this repository will be tolerated. To ensure the solution is not getting revealed, the tests should be Input/Output-Tests.

The Übungsleitung is not responsible for this repository. Therefore no support is given by the Übungsleitung. Just use the Issue feature here.

Examples:

correct:

// Test Area calculation
// Arrange
Rectangle r1 = new Rectangle(length: 4, width: 4)
// Act & Assert
assertEquals(16, r1.calculateArea());

wrong!:

// Test Area calculation
// Arrange
Rectangle r1 = new Rectangle(length: 4, width: 6)
// Act & Assert
// Calculate using length * width             // <-- reveales the solution
assertEquals(4*6, r1.calculateArea()); // <-- reveales the solution

Usage

  1. Clone this repository
git clone https://github.com/LadnerJonas/PGdP-Tests-WS21-22.git
  1. Check for updates
git pull
  1. Add the test folder to your src-folder of your artemis java project

    Or use the syslink instruction below.

  2. Make sure your IDE (e.g. IntelIJ or Eclipse) sees your added files

  3. Include JUnit to your Project by pressing the red lightbulb (or ALT + ENTER in IntelIJ) on one of the red underlined @Test Annotations in the test file.

image

  1. Do not add them to your artemis git repository
  2. Run the tests and check your mistakes

image

image

Important note

As this is a student-driven project please keep in mind that mistakes can happen. If you think a test is wrong, please feel free to open an Issue (it is easy!). To help fixing bugs, please add following info to your Issue:

  • Operating system
  • IDE (IntelIJ, Eclipse, ...)
  • Where is the mistake / error
  • Citation of the homework instruction

How to use syslinks (Advanced Users only!)

Windows

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

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

Linux/MacOS

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

Shoutout to the Contributors of the TUM_GAD_Tests_SS21-Repository for this great tip!


How to contribute

  1. Fork Repository (Github Documentation)
  2. Add / edit tests under <EXERCISE>/src/test
  3. Ensure no solution or homework-code is getting revealed
  4. Commit and push to your fork repository
  5. Open a Pull Request to this repository (Github Documentation)
  6. Wait until the changes are merged

Helpful links

Write Tests using JUnit 5

How to use Git

How to use Github


Contact

Feel free to contact me via email, but consider using google beforehand:

[email protected]


Comments
  • registerUnusedFoodTest implemented incorrectly

    registerUnusedFoodTest implemented incorrectly

    Homework Number (example: W06H01):

    PinguFoodLogisticsTest.java line 47:

    wrong assumption about wasted food, statistic shall not be set to zero after clearing orderBook. Right would be: "Bisher konnten 15 Tiere mit einem Gesamtgewicht von 2373g nicht verwertet werden. Claudia und Karl-Heinz ist dadurch ein Profit von 35595PD entgangen."

    opened by fabianscode 9
  • W08H01: Missing Test: solveMazeFrom impossible path from position to exit

    W08H01: Missing Test: solveMazeFrom impossible path from position to exit

    Homework Number: W08H01

    Citation of the homework instruction:

    static Path solveMazeFrom(Maze maze, Position position): [....] Sollte ein solcher Pfad nicht mehr existieren, soll null zurückgegeben werden.

    Additional Information:

    Maze [....] du kannst aber davon ausgehen, dass der exit immer vom entrance aus erreichbar ist.

    Position can be != Entrance, and thus, this case has to be tested aswell. #33

    Thanks @Mani 🏅

    help wanted 
    opened by LadnerJonas 7
  • LinkedDocumentCollectionTest

    LinkedDocumentCollectionTest

    Homework Number W0701

    line 109. Meiner Meinung nach sollte size 5 und nicht 4 sein. Wir haben vor line 108 3 LinkedDocuments und 1 DummyLinked(Adresse abc) in der Sammlung. Allerdings entfernt die add Methode keine Dummy Elemente? Zumindest kann ich das der Aufgabenstellung nicht entnehmen. Folglich sollte also in der Collection einfach ein LinkedDocument eingefügt werden, welches die gleiche Addresse wie das DummyElement hat.

    opened by YannickWiest 5
  • Added some tests

    Added some tests

    Homework Number: W10H02 (A Heap of Nodes [Bonusaufgabe])

    A short description of the changes proposed in the pull request: I added some tests on every method we should implement. I equal-checked the heaps with the use of the toString() that we should implement, which means that the whole tests are dependent on toString(), which is not the best implementation but for finding your own fault it should be enough. Otherwise an implementation of another comparison algorithm is of course possible to (for example the toList() method or a recursive method going through all nodes and comparing them).

    I even implemented a TestObject to check if the student used the compareTo()-method because most of us only used Integers as the generic type, but other generic types are also possible!

    Some info on the testDelMin()-method: I know that some of the students implemented it in another way. I asked which of the implementations are right on Zulip today, but did not get any answer yet: (https://zulip.in.tum.de/#narrow/stream/879-PGdP-W10H02--.20A.20Heap.20of.20Nodes/topic/delMin.28.29/near/431120). So please be uptodate with the zulipstream and if my tests are wrong because my implementation is, I will change it of course and submit it again.

    P.S.: It is my first time writting tests for this github repo and even the first time creating a pull request and working with github in general, so if I did something wrong I am very sorry and just tell me. P.S.2: As i already mentioned the tests are far from being programmed in a nice way, so I am sorry for that too. But i guess they should be fine to cover the basic implementation. I hope that they do not reveal any solutions, because the toString() method should not be part of giving any solutions out. (But I am not quite sure...)

    • [x] Solution is not getting revealed
    • [x] Files are formatted
    opened by armanhbi 3
  • Change assessment of insert()

    Change assessment of insert()

    Homework Number W09H01

    Citation of the homework instruction: insert() Falls ein gleiches Tupel bereits vorhanden ist, wird das übergebene Tupel verworfen. Es soll das Tupel zurückgegeben werden, welches letztendlich im Pool gespeichert ist.

    Additional Information: If I understand assertEquals() correctly, it assesses the equality of the given tuples. For that, it uses our implementation of tuple.equals(other). What we want though, is an assessment of identity.

    This should fail, but does not: assertEquals(tuple0Duplicate, pool0.insert(tuple0Duplicate));

    I suggest, we change the test according to this example:

    assertEquals(tuple0, pool0.insert(tuple0Duplicate)); //old
    
    /* assertEquals(expected, test of identity) */
    assertEquals(true, pool0.insert(tuple0Duplicate) == tuple0);
    assertEquals(false, pool0.insert(tuple0Duplicate) == tuple0Duplicate);
    
    bug 
    opened by antecrescent 3
  • toString TradeOrder

    toString TradeOrder

    Homework Number (example: W06H01):

    Citation of the homework instruction: toString: TradeOrder: Die⎵Bestellung(Einzeln)⎵hat⎵ein⎵Gesamtgewicht⎵von⎵g⎵und⎵kostet⎵PD.

    Der Wert eines PinguFood-Objekts berechnet sich durch weight*ppg

    Additional Information: Ich habe das so verstanden, dass totalCost nicht die Kosten pro Gramm sind, wie es in den Tests suggeriert wird, sondern der Preis der ganzen Bestellung, also für 200g mit einem Preis von 2, dann 400PD.

    Englisch: I understood it to mean that totalCost is not the cost per gram, as suggested in the tests, but the price of the entire order, i.e. for 200g with a price of 2, then 400PD.

    edit: Der Wert eines PinguFood-Objekts berechnet sich durch weight*ppg

    opened by FB100 3
  • W03H01 - Warum null als Datum?

    W03H01 - Warum null als Datum?

    Hi, ich verstehe nicht warum beim AuthorTest bei testEquals() beim letzten Testfall null für birthday angegeben wird. Das führt doch normalerweise zu einer NullPointerException.

    assertFalse(AUTHOR.equals(new Author("Max", "Mustermann", "Pinguinstraße 1",
                    "[email protected]", null)));
    

    In der Angabe wird jedoch nirgends der Fall beschrieben, dass birthday (oder ein anderer Parameter) null ist, warum wird er dann hier auf so ein Fall getestet? Oder hab ich was falsch verstanden?

    LG

    good first issue pending 
    opened by EweLoHD 3
  • W12H01 test, getComputeThreadCounter

    W12H01 test, getComputeThreadCounter

    W12H01 tests:

    Is it possible that the tests don't consider the following scenario? https://zulip.in.tum.de/#narrow/stream/893-PGdP-W12H01--.20Parallel.20PinguMath/topic/.E2.9C.94.20ComputeThreadCounter It seems like testMinDim, testMultithreadingAddition, and testMultithreadingMultiplication expect the getComputerThreadCounter to be 4/8, but it's possible to have 5/9 if a thread has been started as described in the Zulip post.

    Sorry if this has been mentioned somewhere else, and thanks for the tests :)

    opened by rastko2045 2
  • Tests für W12H01 - Parallel PinguMath

    Tests für W12H01 - Parallel PinguMath

    Homework Number: W12H01 - Parallel PinguMath

    A short description of the changes proposed in the pull request:

    • [x] Solution is not getting revealed
    • [x] Files are formatted
    opened by philippspohn 2
  • W11H02 Code with user input

    W11H02 Code with user input

    Homework Number: W11H02

    A short description of the changes proposed in the pull request: I put the code in a java class so that you can compare what the output is for any user input to see if the minijava code returns the same result

    • [x] Solution is not getting revealed
    • [x] Files are formatted
    opened by flooxo 2
  • Create testMaze1.txt

    Create testMaze1.txt

    have people add different kinds of txt files used for useful test creation?

    Homework Number: W08H01 A short description of the changes proposed in the pull request: Added txt file with maze which can be used for testing [//]: <> (change [ ] to [x] in order to check the box)

    • [x] Solution is not getting revealed
    • [x] Files are formatted
    opened by moritzKoebe 2
Owner
Jonas Ladner
Computer Science @ TUM
Jonas Ladner
This is a repository to collect JUnit Tests for GAD exercises at TUM in SS21

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 student

null 41 Oct 31, 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
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
Web automation example code of tests running parallely

Don't forget to give a ⭐ to make the project popular. ❓ What is this Repository about? This repo contains example code to run a single test parallely

Mohammad Faisal Khatri 1 Apr 3, 2022
A project was created using the API of the TMDB page

TMDB API The project was created using the API of the TMDB page. You can find the description of the functions and their usage at https://developers.t

Atakan Koçyiğit 3 Jan 27, 2022
This is an experiment project I used to learn more about UI Automation with Playwright

Automated Wordle using Playwright (Java) This is an experiment project I used to learn more about UI Automation with Playwright. What's in this reposi

Tom Cools 4 Jan 30, 2022
Sikuli's official repository on github. Ask questions or report bugs at http://launchpad.net/sikuli.

!!!This Sikuli X-1.0rc3 IS NO LONGER SUPPORTED !!! A new version of Sikuli(X) is available since 2013 as a follow up development GitHub repo: RaiMan/S

Sikuli Lab 1.7k Jan 3, 2023
This repository contains my solutions to programming problems of the UVa online-judge.

UVa Solutions This repository contains my solutions to programming problems of the UVa online-judge. Problem Set Volumes (100...1999) Volume 12 Proble

Tahanima Chowdhury 7 Nov 15, 2021
This repository contains examples using TestContainers in a Spring Boot Application

Sample REST CRUD API with Spring Boot, Mysql, JPA and Hibernate Using TestContainer to assure our Integration/API testing Steps to Setup 1. Build and

Guilherme Rogatto 4 Nov 29, 2021
This repository contains example codes which will help you to know how to use selenium webdriver.

❓ What is this Repository about? This repo has example codes with Selenium 4 features. Websites used for testing are: automationpractice.com, saucedem

Mohammad Faisal Khatri 86 Dec 30, 2022
The purpose of this repository is to help contributors find GSoC organizations through their technology stack

The purpose of this repository is to help contributors find GSoC organizations through their technology stack. If it can help you, please give me a ??

erdengk 196 Jan 9, 2023
Library that allows tests written in Java to follow the BDD style introduced by RSpec and Jasmine.

J8Spec J8Spec is a library that allows tests written in Java to follow the BDD style introduced by RSpec and Jasmine. More details here: j8spec.github

J8Spec 45 Feb 17, 2022
Serenity BDD is a test automation library designed to make writing automated acceptance tests easier, and more fun.

That feeling you get when you know you can trust your tests Serenity BDD is a library designed to make writing automated acceptance tests easier, and

Serenity BDD 654 Dec 28, 2022
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
Most popular Mocking framework for unit tests written in Java

Most popular mocking framework for Java Current version is 3.x Still on Mockito 1.x? See what's new in Mockito 2! Mockito 3 does not introduce any bre

mockito 13.6k Jan 9, 2023
Arbitrary test data generator for parameterized tests in Java inspired by AutoFixture.

AutoParams AutoParams is an arbitrary test data generator for parameterized tests in Java inspired by AutoFixture. Sometimes setting all the test data

null 260 Jan 2, 2023
Utility to automatically manage all web element waits and enables to write wait-free selenium tests.

selenium-auto-wait selenium-auto-wait automatically manages all weblement waits and makes you to write wait free selenium tests. Features Waits till e

Sudharsan Selvaraj 31 Nov 1, 2022
🔌 Simple library to manipulate HTTP requests/responses and capture network logs made by the browser using selenium tests without using any proxies

Simple library to manipulate HTTP requests and responses, capture the network logs made by the browser using selenium tests without using any proxies

Sudharsan Selvaraj 29 Oct 23, 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