Code Monkey home page Code Monkey logo

jpacman-framework's Introduction

build status

JPacman-Framework

About

Pacman-like game used for teaching software testing. It exposes students to the use of git, maven, JUnit, and mockito.

Parts of the code are well tested, whereas others are left untested intentionally. As a student in software testing, you can extend the test suite, or use the framework to build extensions in a test-driven way. As a teacher, you can use the framework to create your own testing exercises.

As a starting point for working on your own solution, a template solution is available.

We have developed and are using this code at a software testing course at Delft University of Technology, The Netherlands. Teachers interested in seeing the exercises I use there are invited to contact me.

Other universities who have used this material include Antwerp, Mons, Eindhoven, and UBC (Vancouver). At TU Delft, we use it in combination with gitlab as continuous integration and feedback server.

If you have any suggestions on how to improve this framework, please do not hesitate to contact us, open issue, or provide a pull request. Since testing is deliberately left as an exercise, pull requests that "solve" exercises or offer full coverage are less likely to be merged.

Main contributors:

  • Arie van Deursen (versions 1.0-5.x, 2003-2013, updates to versions 6.x and further, 2014-...)
  • Jeroen Roosen (major rewrite, version 6.0, 2014)

Getting Started

  1. Git clone the project
  2. If you use Eclipse:
    1. Import
    2. Right Click -> Configure -> Convert to Maven Project
  3. To see JPacman in action: run nl.tudelft.jpacman.Launcher. From the command line, run java -classpath target/jpacman-framework-<VERSION>.jar nl.tudelft.jpacman.Launcher
  4. To run the test suite in maven: mvn test
  5. To run the test suite in Eclipse: right click -> run as -> JUnit Test.

jpacman-framework's People

Contributors

avandeursen avatar casperboone avatar gijsweterings avatar huang-da avatar inventitech avatar jeroenroosen avatar liamclark avatar lotterleben avatar mauricioaniche avatar meesfrensel avatar mernst avatar michaeldejong avatar miguendes avatar mpsijm avatar qdrien avatar timvdlippe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jpacman-framework's Issues

jdk9 compatibility

JPacman currently works with the checkerframework, which presently is not ready for jdk9.

See typetools/checker-framework#1224

We need to update the pom.xml file so that mvn verify passes for the jpacman-framework, also when jdk 9 is used.

FindBugs gives an error and creates an empty HTML report

Does anybody else get the same problem when executing mvn site?

[INFO] Generating "Checkstyle" report --- maven-checkstyle-plugin:2.12
[INFO]
[INFO] Generating "FindBugs Report" report --- findbugs-maven-plugin:2.3.2
[INFO] canGenerate is true
[INFO] canGenerate is true
[INFO] Locale is en
[INFO] ****** FindBugsMojo executeReport *******
[INFO] XML outputFile is /home/mbeller/Preaching/jpacman-framework/target/findbugsXml.xml
[INFO] XML output Directory is /home/mbeller/Preaching/jpacman-framework/target
[INFO] ****** FindBugsMojo executeFindbugs *******
[INFO] Temp File is /home/mbeller/Preaching/jpacman-framework/target/findbugsTemp.xml
[INFO] Fork Value is true
[java] Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 35328
[java] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[java] at edu.umd.cs.findbugs.asm.FBClassReader.accept(FBClassReader.java:44)
[java] at org.objectweb.asm.ClassReader.accept(Unknown Source)
[java] at edu.umd.cs.findbugs.classfile.engine.ClassParserUsingASM.parse(ClassParserUsingASM.java:93)
[java] at edu.umd.cs.findbugs.classfile.engine.ClassParserUsingASM.parse(ClassParserUsingASM.java:414)
[java] at edu.umd.cs.findbugs.classfile.engine.ClassInfoAnalysisEngine.analyze(ClassInfoAnalysisEngine.java:65)
[java] at edu.umd.cs.findbugs.classfile.engine.ClassInfoAnalysisEngine.analyze(ClassInfoAnalysisEngine.java:39)
[java] at edu.umd.cs.findbugs.classfile.impl.AnalysisCache.getClassAnalysis(AnalysisCache.java:214)
[java] at edu.umd.cs.findbugs.ba.XFactory.getXClass(XFactory.java:581)
[java] at edu.umd.cs.findbugs.ba.AnalysisCacheToAnalysisContextAdapter.setAppClassList(AnalysisCacheToAnalysisContextAdapter.java:319)
[java] at edu.umd.cs.findbugs.FindBugs2.createAnalysisContext(FindBugs2.java:785)
[java] at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:187)
[java] at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:348)
[java] at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1057)
[java] Java Result: 1
[INFO] No bugs found
[INFO] Generating "Surefire Report" report --- maven-surefire-report-plugin:2.17

scenarios.md unclarity

Written in scenarios.md is:

Scenario S3.2: The ghost moves over food.
Given the game has started,
and a ghost is next to a cell containing food;
When a tick event occurs;
Then the ghost can move to the food cell,
and the food on that cell is not visible anymore.

However, I can not seem to find an implementation of food anywhere in the framework, are pellets meant with "food" ?

Inky description not correct

Imported from GitLab, original author: [hidden-student]

In the javadoc of Inky it says inky has the bug from the original pacman. This is the bug where if pac-man looks up the spot used for pinky his new location is 2 squares away from pacman to the north and to the west. However this is not correctly implemented and the spot is just 2 squares to the north.

Investigate dependency resolution issue with JUnit

There appears to be a dependency resolution issue with JUnit. Cucumber 1.2.4 requires JUnit 4.11, whereas the framework requires JUnit 4.12.

There seem to be two possible solutions:

  1. Exclude the JUnit dependency on Cucumber in the pom.xml
  2. Bump cucumber to version 1.2.5-SNAPSHOT which does depend on JUnit 4.12 (originally junit 4.12 broke compatibility with android) See #82 (comment)

Mockito extension

Imported from GitLab, original author: @LiamClark

Mockito now ships an extension as support for JUnit 5.

We should add this as a dependency to use for students. This also allows us to finally drops the dependency on JUnit 4.

Removing JUnit 4 from the project will eliminate a set of errors, due to mixing JUnit 4 and JUnit 5 imports.

Cucumber Interference

The Framework's Cucumber features and step definitions are part of the test jar, which is imported in the template. This has the effect that the same step definitions also apply in solutions based on the template, which is counter intuitive.

A solution might be to drop the test jar dependency in the template.

The 'workaround' now is

  1. To use a uniquely named feature folder in the solution
  2. To shadow nl.tudelft.jpacman.cucubmer.StateNavigationSteps by having that same package/class in the solution.

jpacman-Study

Hello !! My name is Pedro and I am from Oporto,Portugal.I am currently in the 3rd year of the course of Computer Engineering at FEUP( Engineering College of University of Oporto ) and im doing a work for a class named Software Engineering( ESOF) tha basically consists in studying a open source project avayable on Github. I would like to know if someone could talk me about jpacman testability and how hard or no is to build tests for jpacman and what are the big concerns about testing jpacman functionallity.

Thanks a lot and sorry for any problem i may had cause here.

Exception Handling

Currently, incorrect configuration can throw IOException and IllegalArgumentException, which in some cases are wrapped into RuntimeException.

My proposal is to introduce one top level checked PacmanConfigurationException, which can replace/wrap the existing exceptions.

/cc @rsouzacoelho

Open map parser for extension

Make the MapParser.addSquare method protected instead of private, so that extensions can reuse the existing map actions.

Migrate to Gradle

Just tossing around the thought for improvement next year: migrate the framework (and template alike) to Gradle.

Why?

Running mvn site on the template, the jacoco report does not correctly generate code coverage for the framework. There are various solutions for that in Gradle, which do not exist in maven.
Moreover, Gradle is usually easier to read and more maintainable as well as widely used in recent industry projects.

Regarding editor support: IntelliJ has nice integration for Gradle on every OS, just like it has for mvn.

Missing proper exception mapdesign without player

If a user tries to parse a map without putting a player on that map, an IndexOutOfBoundsException will be thrown. This exception doesn't tell the user anything about his possible error. It would be better to throw a PacManConfigurationException, because this will tell the user what is going wrong, and gives an indication as to how this problem can be fixed.

Clean up javadoc.

The mvn javadoc:javadoc still gives warnings -- these need to be fixed.

Rethink PMD rules used

PMD 6 has re-organized its rule sets, making the old PMD categories JPacman used obsolete.

PR #120 just re-added the best practices, but it would be better to rethink all rules used, and to update the pmd-rules.xml file accordingly.

This relates to the (lack of) JUnit 5 rules for PMD.

Include mutation testing

I want to make a quick PoC for mutation testing with pitest.
Would it be interesting to include this in the main repository?

For now I'm using and configuring it via Maven.

Remove Cobertura from reporting

Cobertura is not able to parse any Java 8 statement and Jacoco seems to be a good replacement. Therefore we should remove Cobertura.

However, as @jwgmeligmeyling pointed out, DevHub still uses Cobertura for the warning system. We therefore need to wait till DevHub is updated before removing this plugin.

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.