Skip to content

Commit

Permalink
Adding Wordpress case studies
Browse files Browse the repository at this point in the history
  • Loading branch information
xdevroey committed Mar 29, 2018
1 parent ae651ee commit c57f1d3
Show file tree
Hide file tree
Showing 39 changed files with 67,125 additions and 9 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# vibes-casestudies
This repository contains several case studies, with their Feature Models and Featured Transition Systems, used for VIBeS evaluations.
# VIBeS Case Studies

This repository contains several case studies, with their Feature Models and Featured Transition Systems, used for [VIBeS](https://github.com/xdevroey/vibes) evaluations.
5 changes: 2 additions & 3 deletions claroline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ Devroey, X., Perrouin, G., Cordy, M., Samih, H., Legay, A., Schobbens, P.-Y. and
number = {1},
pages = {153--171},
month = {feb},
year = {2017}
publisher = {Springer},
doi = {10.1007/s10270-015-0479-8},
year = {2017},
publisher = {Springer}
}
```

Expand Down
2 changes: 0 additions & 2 deletions fm-statistics.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ file,model,featurescount,commonfeaturescount,deadfeaturescount,mandatoryfeatures
aerouc5.splot.xml,aerouc5,25,13,0,10,2,7,64.000
ageRR.splot.xml,ageRR,45,1,0,0,3,0,4.3980e+12
ageRRN.splot.xml,ageRRN,45,1,0,0,3,0,4.3980e+12
ageRRNV.splot.xml,ageRRNV,45,1,0,0,3,0,4.3980e+12
claroline.splot.xml,claroline,44,10,0,9,16,156,5.4067e+06
cpterminal.splot.xml,cpterminal,21,4,0,4,2,4,4774.0
elsaRR.splot.xml,elsaRR,70,1,0,0,3,0,1.4757e+20
elsaRRN.splot.xml,elsaRRN,70,1,0,0,3,0,1.4757e+20
elsaRRNV.splot.xml,elsaRRNV,70,1,0,0,3,0,1.4757e+20
minepump.splot.xml,minepump,9,3,0,2,4,0,32.000
svm.splot.xml,svm,9,3,0,2,2,0,24.000
2 changes: 0 additions & 2 deletions fts-statistics.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ model,name,actionscount,transitionscount,avgdegree,bfsheight,backlvltransitionsc
aerouc5,Sferion(TM) Aero UC5,12,46,1.84,16,14,25
ageRR,Wordpress AGE (RR reverse),773,6639,8.59,329,411,772
ageRRN,Wordpress AGE (RRN reverse),1102,10960,9.95,425,664,1101
ageRRNV,Wordpress AGE (RRNV reverse),18389,103815,5.65,9217,10602,18388
claroline,Claroline,107,2053,19.37,1,105,106
cpterminal,Card payement terminal,16,17,1.54,7,4,11
elsaRR,Wordpress Elsa (RR reverse),385,1214,3.16,195,174,384
elsaRRN,Wordpress Elsa (RRN reverse),618,1771,2.88,371,297,615
elsaRRNV,Wordpress Elsa (RRNV reverse),1147,2698,2.35,684,568,1146
minepump, Mine pump,24,41,1.64,15,9,25
svm,Soda vending machine,13,13,1.44,5,3,9
77 changes: 77 additions & 0 deletions wordpress/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@

# WordPress, an open-source CMS


## Description

[WordPress](https://wordpress.org) is a popular open-source Content Management System (CMS) used by more than 60 million websites. It includes a plugin architecture and a template system, allowing one to modify its behaviour by adding new functionalities (i.e., plugins), or the rendering of the website (i.e., themes), respectively. In February 2017, the WordPress database counted 48,898 plugins and 4,462 (latest) themes.

We reverse-engineered the feature models and the FTSs of two WordPress instances, AGE and Elsa portals, based on their Apache webserver log file. The [AGE website](http://www.age-namur.be) is the portal of the general student assembly of the University of Namur. It uses a dedicated WordPress instance and provided us a log file with 1,285,592 entries from May 2013 to March 2014. The [European Law Students' Association (Elsa) of Louvain-la-Neuve](http://elsa-lln.be) also uses a dedicated WordPress instance and provided us a log with 48,823 entries from February 2014 to the end of April 2014.

## Feature Model

![Wordpress Simplified Feature Model](wordpress-simplified-fm.png)

Our WordPress feature model has 3 optional core features: Plugins, Themes, and Admin\_user. One configuration (i.e., product) of the feature models represents the minimal instance needed to play a test suite. The Admin\_user feature will be selected only if a test case requires to access the administration pages.

To identify the plugins and themes used in the instances, we analysed the Apache webserver log entries. Each time an HTTP request is addressed to the server, one entry is created in the log file with the following format: the IP address of the visitor sending the request; a login if the visitor is identified on the system; the date and time of the request; the HTTP request itself, beginning with GET, POST, etc., followed by a URL and the protocol version; the status code sent back to the client; the size of the object returned to the client; the website the client reports having been referred from; and finally the information on the client's browser. For instance, a request to the `index.php` page of the WordPress instance from a Mozilla Firefox navigator will add the following entry in the log file:

```
66.155.40.250 - - [08/Nov/2013:11:38:11 +0100] "GET /index.php?p=potins&action=aimepas&id=135 HTTP/1.1" 200 708388 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0"
```

Plugins and themes resources are placed in specific folders on the webserver. This allows us to filter the URL of the log entries using the following regular expressions:

- `.*/wp-content/plugins/([^/]+)/.*` to detect access to a plugin resource;
- `.*/wp-content/themes/([^/]+)/.*` to detect access to themes resources;
- `.*/wp-admin/.*` to detect that an administration page has been used.

The names of the plugins and themes appears right after the `plugins/` and `themes/` part of the URL (matched by the `([^/]+)` part of the regular expression). Since the logs have been anonymized, we do not have the identification of the users and rely on the last regular expression to detect administrator accesses to the WordPress instance.

We ended up with two feature models: one with 45 features for the AGE WordPress instance, and one with 70 features for the Elsa WordPress instance.
The root feature WordPress is decomposed in three optional sub-features: Admin\_user, Themes, and Plugins. Each plugin or theme (resp.) appearing in a log entry will be a sub-feature of the Plugins or Themes (resp.) feature.

## Featured Transition System

We reverse engineered the FTSs of the AGE and Elsa WordPress instances using a 2-gram (bigram) inference method. This method uses a set of user sessions (i.e., sequences of HTTP requests) to generate a navigational model of a website. In the generated FTS, the states represents the last user request and the transitions represents the sequence between two requests. Transitions leading to a request identified as part of a plugin or a theme, or as accessible only by an administrator (using the regular expressions from the previous section) are labelled with the corresponding feature expression.

The n-gram inference method has been proposed by [Sprenkle et al.](http://dx.doi.org/10.1002/stvr.1496) and used to test website in a black box fashion. They experiment the inference with different configurations and values of *n* greater than 2 and found out that a small *n* allows better diversity in the behaviours (ending up in more diverse test cases), and requires less sessions to reach growth stability of the model. Small *n* also simplifies the generation and results in a more compact model. This motivates our choice to select 2-gram for the inference.

### User sessions

One user session corresponds to a sequence of HTTP requests, representing the sequence of pages consulted by the user. User sessions can be extracted from the Apache webserver log by grouping entries with the same IP address (assuming that one IP corresponds to one user) and logged within a same time frame. This means that two entries in a user session may not be distant by more than a maximal timeout (we arbitrarily choose to set a timeout of 3 minutes). If the timeout is reached, the next entry will be the first of a new user session.

To build the user sessions, we only consider some relevant elements of the HTTP request. This allows to group behaviour of various users to identify common usage scenarios. Amongst the possible group of elements, we considered:

- Request type and Resource (RR), which uses the type of HTTP request (e.g., `POST` or `GET`) and the resource name (e.g., `/index.php`) for a user session element;
- Request type, Resource, and parameters Names (RRN), which also uses the HTTP request type and the name of the resource, but also the name of the parameters in the resource (e.g., `?p=&action=&id=`).

#### Bigram inference

![Bigram Inference Algorithm](bigram-algo.png)

Using a bigram inference, the next state only depends on the current state of the system. As a consequence, user session entries are considered two by two: the last user request, which is the current state, and the next request of the user, which is the next state of the system.

Algorithm presents the bigram inference of the FTS for a WordPress instance, based on a set of user sessions. The elements of the FTS are initialised. For each session, the sequence of requests enriches the model: sessions starts from a virtual state *s0* and the first sequence adds a transition from this state to a new state corresponding to the first element of the sequence; transitions are labelled with actions representing the request of another page; and each new transition is labelled with a feature expression.
This feature expression corresponds to the conjunction of the previous feature expression if there is one or true otherwise, and the name of a plugin, a theme, or the administrator user if the requested resource matches one of the corresponding regular expression. Function `fLabels` enriches *gamma* definition, based on its previous definition and the given transition.
This process iterates for each request in the sequence, the starting state corresponding to the target state of the previous iteration. Finally, each sequence terminates by a special action *req(s0)*, resetting the system, and ends in the virtual state *s0*. The algorithm returns an FTS with the inferred navigational model and a feature diagram. We implemented Algorithm in an open source tool: [Yet Another Model Inference tool (YAMI)](https://github.com/xdevroey/yami).

We built four FTSs: two using Request type and Resource (RR) parts of the URLs as sequence elements in the user sessions (*AGE-RR* with 772 states and 6,639 transitions, and *Elsa-RR* with 384 states and 1,214 transitions), and two using Request type, Resource, and parameter Names (RRN) parts of the URLs (*AGE-RRN* with 1,101 states and 10,960 transitions, and *Elsa-RRN* with 615 states and 1,771 transitions). The process took 3 seconds to process the 3,964 sessions of the Elsa models (average session size=9.57, *sigma*=46.73) and 54 second to build the 147,173 sessions of the AGE models (average session size=5.10, *sigma*=61.04) on a Ubuntu Linux machine (Linux version 3.13.0-65-generic, Ubuntu 4.8.2-19ubuntu1) with an Intel Core i3 (3.10GHz) processor and 4GB of memory.


## Reference

Devroey, X., Perrouin, G., Papadakis, M., Legay, A., Schobbens, P.-Y. and Heymans, P. 2018. [Model-based mutant equivalence detection using automata language equivalence and simulations](https://doi.org/10.1016/j.jss.2018.03.010). Journal of Systems and Software. 141, (Jul. 2018), 1–15.

```TeX
@article{Devroey2018,
author = {Devroey, Xavier and Perrouin, Gilles and Papadakis, Mike and Legay, Axel and Schobbens, Pierre-Yves and Heymans, Patrick},
title = {{Model-based mutant equivalence detection using automata language equivalence and simulations}},
journal = {Journal of Systems and Software},
year = {2018},
month = {jul},
volume = {141},
pages = {1--15},
publisher = {Elsevier}
}
```
17 changes: 17 additions & 0 deletions wordpress/ageRR/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Wordpress AGE RR

## Content:

- ageRR.tvl: the variability model in TVL (https://projects.info.unamur.be/tvl/)
- ageRR-fd.png: a graphical representation of the variability model
- ageRR.splot.xml: the variability model encoded in SPLOT (http://www.splot-research.org)
- ageRR.splot.dimacs: the dimacs representation of the variability model, generated from PLEDGE (http://research.henard.net/SPL/PLEDGE/)
- ageRR.usagemodel: the usage model derived from claroline-RR.usagemodel to match actions in claroline.fts
- ageRR.fts: the FTS
- ageRR.ts: the TS (FTS without feature expressions) for testing purpose.


## Feature Model

![Wordpress AGE RR Feature Model](ageRR-fm.png)
Binary file added wordpress/ageRR/ageRR-fm.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions wordpress/ageRR/ageRR.fts

Large diffs are not rendered by default.

93 changes: 93 additions & 0 deletions wordpress/ageRR/ageRR.splot.dimacs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
c 1 AgeRR/ageRR.splot.xml
c 2 Plugins
c 3 Themes
c 4 Admin_user
c 5 Facebook_plugin
c 6 Wpstorecart_plugin
c 7 A1_flash_gallery_plugin
c 8 Gtw_plugin
c 9 Wp_bing_plugin
c 10 Wp_sed_plugin
c 11 Hotfix_plugin
c 12 Mini_mail_dashboard_widget_plugin
c 13 Theme_plugin
c 14 Google_calendar_widget_plugin
c 15 Zingiri_web_shop_plugin
c 16 Akismet_plugin
c 17 Mm_forms_community_plugin
c 18 Thecartpress_plugin
c 19 Braille_plugin
c 20 Premium_Gallery_Manager_plugin
c 21 Lazy_seo_plugin
c 22 Reflex_gallery_plugin
c 23 Tell_a_friend_plugin
c 24 Wp_404_plugin
c 25 Formidable_plugin
c 26 Wp_mailinglist_plugin
c 27 News_plugin_plugin
c 28 Likebtn_like_button_plugin
c 29 Jetpack_plugin
c 30 Karma_theme
c 31 Toolbox_theme
c 32 Sportpress_theme
c 33 Clockstone_theme
c 34 Deep_blue_theme
c 35 Max_theme
c 36 Avenue_theme
c 37 Maintheme_theme
c 38 Kiddo_theme
c 39 Yoko_theme
c 40 Twentytwelve_theme
c 41 U_design_theme
c 42 Purevision_theme
c 43 Twentyeleven_theme
c 44 Twentyten_theme
c 45 OptimizePress_theme
p cnf 45 47
1 0
-2 1 0
-3 1 0
-4 1 0
-5 2 0
-6 2 0
-7 2 0
-8 2 0
-9 2 0
-10 2 0
-11 2 0
-12 2 0
-13 2 0
-14 2 0
-15 2 0
-16 2 0
-17 2 0
-18 2 0
-19 2 0
-20 2 0
-21 2 0
-22 2 0
-23 2 0
-24 2 0
-25 2 0
-26 2 0
-27 2 0
-28 2 0
-29 2 0
-2 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 0
-30 3 0
-31 3 0
-32 3 0
-33 3 0
-34 3 0
-35 3 0
-36 3 0
-37 3 0
-38 3 0
-39 3 0
-40 3 0
-41 3 0
-42 3 0
-43 3 0
-44 3 0
-45 3 0
-3 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 0
69 changes: 69 additions & 0 deletions wordpress/ageRR/ageRR.splot.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!--
Generated on Fri Aug 05 14:24:02 CEST 2016
using VIBeS (https://projects.info.unamur.be/vibes/)
-->
<feature_model name="AgeRR/ageRR.splot.xml">
<meta>
<data name="description"></data>
<data name="creator">Xavier Devroey</data>
<data name="address"></data>
<data name="email">xavier.devroey@unamur.be</data>
<data name="phone"></data>
<data name="website">https://sites.google.com/site/xdevroey/home</data>
<data name="organization">PReCISE</data>
<data name="department">University of Namur</data>
<data name="date">05/08/2016</data>
<data name="reference"></data>
</meta>
<feature_tree>
:r AgeRR/ageRR.splot.xml (AgeRR/ageRR.splot.xml)
:o Plugins (Plugins)
:g (plugins_group) [1,*]
: Facebook_plugin (Facebook_plugin)
: Wpstorecart_plugin (Wpstorecart_plugin)
: A1_flash_gallery_plugin (A1_flash_gallery_plugin)
: Gtw_plugin (Gtw_plugin)
: Wp_bing_plugin (Wp_bing_plugin)
: Wp_sed_plugin (Wp_sed_plugin)
: Hotfix_plugin (Hotfix_plugin)
: Mini_mail_dashboard_widget_plugin (Mini_mail_dashboard_widget_plugin)
: Theme_plugin (Theme_plugin)
: Google_calendar_widget_plugin (Google_calendar_widget_plugin)
: Zingiri_web_shop_plugin (Zingiri_web_shop_plugin)
: Akismet_plugin (Akismet_plugin)
: Mm_forms_community_plugin (Mm_forms_community_plugin)
: Thecartpress_plugin (Thecartpress_plugin)
: Braille_plugin (Braille_plugin)
: Premium_Gallery_Manager_plugin (Premium_Gallery_Manager_plugin)
: Lazy_seo_plugin (Lazy_seo_plugin)
: Reflex_gallery_plugin (Reflex_gallery_plugin)
: Tell_a_friend_plugin (Tell_a_friend_plugin)
: Wp_404_plugin (Wp_404_plugin)
: Formidable_plugin (Formidable_plugin)
: Wp_mailinglist_plugin (Wp_mailinglist_plugin)
: News_plugin_plugin (News_plugin_plugin)
: Likebtn_like_button_plugin (Likebtn_like_button_plugin)
: Jetpack_plugin (Jetpack_plugin)
:o Themes (Themes)
:g (themes_group) [1,*]
: Karma_theme (Karma_theme)
: Toolbox_theme (Toolbox_theme)
: Sportpress_theme (Sportpress_theme)
: Clockstone_theme (Clockstone_theme)
: Deep_blue_theme (Deep_blue_theme)
: Max_theme (Max_theme)
: Avenue_theme (Avenue_theme)
: Maintheme_theme (Maintheme_theme)
: Kiddo_theme (Kiddo_theme)
: Yoko_theme (Yoko_theme)
: Twentytwelve_theme (Twentytwelve_theme)
: U_design_theme (U_design_theme)
: Purevision_theme (Purevision_theme)
: Twentyeleven_theme (Twentyeleven_theme)
: Twentyten_theme (Twentyten_theme)
: OptimizePress_theme (OptimizePress_theme)
:o Admin_user (Admin_user)
</feature_tree>
<constraints>
</constraints>
</feature_model>
Loading

0 comments on commit c57f1d3

Please sign in to comment.