openshiftio / openshift.io

Red Hat OpenShift.io is an end-to-end development environment for planning, building and deploying modern applications.
https://openshift.io
97 stars 66 forks source link

For a source code base, Identify key functions and generate missing unit tests #1792

Open krishnapaparaju opened 6 years ago

krishnapaparaju commented 6 years ago

We can start off with Java source code...

krishnapaparaju commented 6 years ago

For generating missing unit tests, please check out these links if we can reuse work / collaborate with team at Rice University.

https://www.youtube.com/watch?v=e4CMTk-3iNk

http://pliny.rice.edu/index.html

krishnapaparaju commented 6 years ago

As part of understanding codebase, I have done a small experiment which converts a Java application code base into AST with https://github.com/antlr/antlr4. 'Antlr' does support rich grammars for other well known languages. Please see the attached screen shot capturing AST for the Java application I have tried. Once ASTs are in place, next step can be to figure out 'important functions' at a code base before start planning around AI based test case generation. antlr4_parse_tree_for_a_java_application

maxandersen commented 6 years ago

@krishnapaparaju how are these generated tests supposed to be better than no tests ?

krishnapaparaju commented 6 years ago

@maxandersen this is an experiment to alert if unit tests are missing + auto generate unit tests

krishnapaparaju commented 6 years ago

Implementations around DeepCoder paper (https://openreview.net/pdf?id=ByldLrqlx) can be found at https://github.com/vaporized/DeepCoder-tensorflow & https://github.com/HiroakiMikami/deep-coder.

maxandersen commented 6 years ago

@maxandersen this is an experiment to alert if unit tests are missing + auto generate unit tests

yes, I get that - but what value does it give the users to be told unit tests are missing vs having coverage tests running that would reveal the same ?

what kind of unit tests are expected to be generated ? looking at paper it seem to just be academic boundary tests ? (which can be fine but it would be a big stretch to call those sufficient as unit tests)

pkajaba commented 6 years ago

@krishnapaparaju have you tried researching for existing projects? I stumbled upon this after short search https://github.com/randoop/randoop

sivaavkd commented 6 years ago

Moving this to Backlog