Skip to content

Commit 45fc481

Browse files
first commit
0 parents  commit 45fc481

File tree

763 files changed

+57494
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

763 files changed

+57494
-0
lines changed

.gitignore

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__
3+
*.py[cod]
4+
*$py.class
5+
*.json
6+
.idea/
7+
logs/
8+
9+
# C extensions
10+
*.so
11+
12+
# Distribution / packaging
13+
.Python
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
MANIFEST
30+
31+
# PyInstaller
32+
# Usually these files are written by a python script from a template
33+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34+
*.manifest
35+
*.spec
36+
37+
# Installer logs
38+
pip-log.txt
39+
pip-delete-this-directory.txt
40+
41+
# Unit test / coverage reports
42+
htmlcov/
43+
.tox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
.hypothesis/
51+
.pytest_cache/
52+
53+
# Translations
54+
*.mo
55+
*.pot
56+
57+
# Django stuff:
58+
*.log
59+
local_settings.py
60+
db.sqlite3
61+
62+
# Flask stuff:
63+
instance/
64+
.webassets-cache
65+
66+
# Scrapy stuff:
67+
.scrapy
68+
69+
# Sphinx documentation
70+
docs/_build/
71+
72+
# PyBuilder
73+
target/
74+
75+
# Jupyter Notebook
76+
.ipynb_checkpoints
77+
78+
# pyenv
79+
.python-version
80+
81+
# celery beat schedule file
82+
celerybeat-schedule
83+
84+
# SageMath parsed files
85+
*.sage.py
86+
87+
# Environments
88+
.env
89+
.venv
90+
env/
91+
venv/
92+
ENV/
93+
env.bak/
94+
venv.bak/
95+
96+
# Spyder project settings
97+
.spyderproject
98+
.spyproject
99+
100+
# Rope project settings
101+
.ropeproject
102+
103+
# mkdocs documentation
104+
/site
105+
106+
# mypy
107+
.mypy_cache/
108+
109+
*.png
110+
*.jpg
111+
.DS_Store
112+
*.npz
113+
*.pkl
114+
115+
*.log
116+
*.dot
117+
*.iml
118+
*~
119+
target/
120+
plugins/jenkins/work
121+
build
122+
transitionLog.txt
123+
evosuite-report
124+
.project
125+
.settings
126+
.classpath
127+
.idea
128+
bin/
129+
examples/mine/
130+
examples/plot/
131+
examples/indi_plot/
132+
src/main/resources/log4j.properties
133+
*.orig
134+
135+
.vagrant/
136+
Main.java
137+
*results*/
138+
*.tar.gz

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 testing-automated-usi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The repository contains two subdirectories to replicate:
2+
- simulation experiments, i.e., [simulation-code](simulation-code/README.md)
3+
- web application subject experiments, i.e., [web-application-code](web-application-code/README.md)

simulation-code/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Code to Replicate Simulation Experiments
2+
3+
# Installation
4+
5+
Install [conda](https://docs.anaconda.com/miniconda/) for your system, as well as [poetry](https://python-poetry.org/docs/). Then type:
6+
7+
```commandline
8+
conda create -n simulation python=3.8
9+
conda activate simulation
10+
poetry install
11+
```
12+
13+
# Run Experiments
14+
15+
Without delay:
16+
17+
```commandline
18+
python test_gen_palyndrome.py --max-string-length 100 --runs-rand 100 --runs-dist 100 --runs-bigrams 100
19+
```
20+
21+
With delay:
22+
23+
```commandline
24+
python test_gen_palyndrome.py --max-string-length 100 --runs-rand 100 --runs-dist 100 --runs-bigrams 100 --delay
25+
```
26+
27+
Please refer to the paper for an estimation of how much time the experiments take.

simulation-code/is_palyndrome.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import time
2+
import datetime
3+
4+
5+
DELAY_SECS = 0.01 # 10ms delay
6+
7+
8+
def is_palyndrom(s: str, delay=False):
9+
if delay:
10+
time.sleep(DELAY_SECS)
11+
if s == "" or len(s) == 1:
12+
return True
13+
while len(s) > 1 and s[0] == s[-1]:
14+
s = s[1 : len(s) - 1]
15+
if s == "" or len(s) == 1:
16+
return True
17+
return False
18+
19+
20+
def is_palyndrom_mu1(s: str):
21+
if s == "" or len(s) == 1:
22+
return True
23+
while len(s) > 1 and s[0] == s[-1]:
24+
s = s[1 : len(s) - 1]
25+
if s == "" or len(s) == 2: # was: len(s) == 1
26+
return True
27+
return False
28+
29+
30+
def timed_is_palyndrom(s: str, delay=False):
31+
start = datetime.datetime.now()
32+
if s == "" or len(s) == 1:
33+
return (datetime.datetime.now() - start).total_seconds()
34+
while len(s) > 1 and s[0] == s[-1]:
35+
s = s[1 : len(s) - 1]
36+
if s == "" or len(s) == 1:
37+
return (datetime.datetime.now() - start).total_seconds()
38+
return (datetime.datetime.now() - start).total_seconds()

simulation-code/poetry.lock

+65
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

simulation-code/pyproject.toml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[tool.poetry]
2+
name = "simulation-code"
3+
version = "0.1.0"
4+
description = ""
5+
authors = ["anon <anon@anon.com>"]
6+
readme = "README.md"
7+
package-mode = false
8+
license = "MIT"
9+
10+
[tool.poetry.dependencies]
11+
python = "^3.8.19"
12+
numpy = "1.22.0"
13+
scipy = "1.5.0"
14+
15+
[build-system]
16+
requires = ["poetry-core"]
17+
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)