All Projects → CodyKochmann → Battle_tested

CodyKochmann / Battle_tested

Licence: mit
Fully automated python fuzzer built to test if code actually is production ready in seconds.

Projects that are alternatives of or similar to Battle tested

Machinelearning Detecting Twitter Bots
Custom classification algorithm to sense the bots vs human on social media space like twitter
Stars: ✭ 75 (-1.32%)
Mutual labels:  jupyter-notebook
Eigenvectors From Eigenvalues
PyTorch implementation comparison of old and new method of determining eigenvectors from eigenvalues.
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Tracktor
Python and OpenCV based object tracking software
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Invitation to julia
Stars: ✭ 75 (-1.32%)
Mutual labels:  jupyter-notebook
Ml2021 Spring
李宏毅 (Hung-Yi Lee) 機器學習 Machine Learning 2021 Spring
Stars: ✭ 69 (-9.21%)
Mutual labels:  jupyter-notebook
Feature Detection
Oriented FAST and Rotated BRIEF using opencv
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Frcnn cad
Computer aided detection using Faster-RCNN
Stars: ✭ 75 (-1.32%)
Mutual labels:  jupyter-notebook
Pythondata
python数据分析代码资料
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Dl Visualization
This is the source code for the animations in the series "Visualizing Deep Learning"
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Data Science Bowl 2018
DATA-SCIENCE-BOWL-2018 Find the nuclei in divergent images to advance medical discovery
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Age Gender Estimation
Keras implementation of a CNN network for age and gender estimation
Stars: ✭ 1,195 (+1472.37%)
Mutual labels:  jupyter-notebook
Okfn.github.com
Open Knowledge Labs website (and general issue tracker).
Stars: ✭ 75 (-1.32%)
Mutual labels:  jupyter-notebook
Cs189 Su18
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Spatialde
Test genes for Spatial Variation
Stars: ✭ 74 (-2.63%)
Mutual labels:  jupyter-notebook
Understaing Datasets Estimators Tfrecords
Try to use tf.estimator and tf.data together to train a cnn model.
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Numpywren
Serverless Scientific Computing
Stars: ✭ 75 (-1.32%)
Mutual labels:  jupyter-notebook
Python Tutorials
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Suspeitando
Projeto de análise de contratos com suspeita de superfaturamento e má qualidade na prestação de serviços.
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Machine Learning For Beginners
Start writing machine learning code in just 10 hours
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook
Kelime kok ayirici
Derin Öğrenme Tabanlı - seq2seq - Türkçe için kelime kökü bulma web uygulaması - Turkish Stemmer (tr_stemmer)
Stars: ✭ 76 (+0%)
Mutual labels:  jupyter-notebook

Battle Tested

Downloads Downloads Downloads Known Vulnerabilities

Fully automated python fuzzer built to test if code actually is production ready in seconds.

How to install it?

pip install --user battle_tested

What does this tool solve?

Python allows you to do pretty much whatever you want. This is a good thing for the most part however it creates the opportunity for unexpected events to occur. One of battle_tested's strongest assets is its ability to show you all of those possibilities so there are no surprises. In a way, it surpasses learning about the behavior of code by reading docstrings because all behaviors are recorded during a fuzz.

For example, the image below shows just how much is brought to light about a piece of code without needing to read a textbook's worth of documentation (which almost never exists) just to learn about the full behavior of a single function.

fuzz test questions

iPython Demo

Python 3.6.1 (default, Apr  4 2017, 09:40:51)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from battle_tested import fuzz

In [2]: def test(a):
   ...:     return int(a)
   ...:

In [3]: fuzz(test)
testing: test()
tests: 4865        1572/sec in 3s
fuzzing test() found:
+------------------------+---------+
|   crash_input_types    |    9    |
|    exception_types     |    3    |
|    iffy_input_types    |    3    |
|      output_types      |    1    |
| successful_input_types |    4    |
|     unique_crashes     |    3    |
+------------------------+---------+
Out[3]:
+------------------------+------------------------------------------------------------------------------------------------------------------------------+
|                        | +------------+                                                                                                               |
|                        | |  NoneType  |                                                                                                               |
|                        | |   bytes    |                                                                                                               |
|                        | |  complex   |                                                                                                               |
|                        | |    dict    |                                                                                                               |
| crash_input_types      | |   float    |                                                                                                               |
|                        | | PrettyIter |                                                                                                               |
|                        | |    list    |                                                                                                               |
|                        | |    str     |                                                                                                               |
|                        | |   tuple    |                                                                                                               |
|                        | +------------+                                                                                                               |
|                        | +---------------+                                                                                                            |
|                        | | OverflowError |                                                                                                            |
| exception_types        | |   TypeError   |                                                                                                            |
|                        | |   ValueError  |                                                                                                            |
|                        | +---------------+                                                                                                            |
|                        | +---------+                                                                                                                  |
|                        | |  bytes  |                                                                                                                  |
| iffy_input_types       | |  float  |                                                                                                                  |
|                        | |   str   |                                                                                                                  |
|                        | +---------+                                                                                                                  |
|                        | +---------+                                                                                                                  |
| output_types           | |   int   |                                                                                                                  |
|                        | +---------+                                                                                                                  |
|                        | +----------+                                                                                                                 |
|                        | |   bool   |                                                                                                                 |
| successful_input_types | | Fraction |                                                                                                                 |
|                        | |   int    |                                                                                                                 |
|                        | |   UUID   |                                                                                                                 |
|                        | +----------+                                                                                                                 |
|                        | +----------------+------------+-----------+--------------------------------------------------------------------------------+ |
|                        | | exception type | arg types  | location  | crash message                                                                  | |
|                        | +----------------+------------+-----------+--------------------------------------------------------------------------------+ |
| unique_crashes         | | OverflowError  | ('float',) | line 1168 | 'cannot convert float infinity to integer'                                     | |
|                        | | TypeError      | ('dict',)  | line 1168 | "int() argument must be a string, a bytes-like object or a number, not 'dict'" | |
|                        | | ValueError     | ('bytes',) | line 1168 | "invalid literal for int() with base 10: b'\\x88pv\\x0b\\xc7\\xa6\\xc1\\x83'"  | |
|                        | +----------------+------------+-----------+--------------------------------------------------------------------------------+ |
+------------------------+------------------------------------------------------------------------------------------------------------------------------+

More Example Usage

from battle_tested import battle_tested, fuzz

@battle_tested(default_output=[], verbose=True, seconds=1, max_tests=5)
def sample(i):
    return []

@battle_tested()
def sample2(a,b,c,d=''):
    t = a, b, c, d

# proof that they only get tested once
print(sample(4))
print(sample2(1,2,3,4))
print(sample('i'))
print(sample2('a','b',2,4))

#======================================
#  Examples using the function syntax
#======================================

def sample3(input_arg):
    return True

fuzz(sample3, seconds=5, verbose=True)

Contributors

Cody Kochmann lead author
Marcin Pohl advising for better performance and resource utilization
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].