= RO-based Regression Testing

:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Given

* RO App uses all/most features of the FW,
* RO App tests are included in the FW coverage, and
* Recording caught all/most functions of the App

When

* Recorded events are replayed

Then

* FW test coverage should increase

.Record and Replay
[plantuml,file="regression-test.png"]
----
@startuml

: : -> FE : action

component kroviz <<RO FrontEnd>> as FE {
    database EventLog as EL
    FE -> EL
}

note bottom of EL
Req./Resp.
as well as UI
events are recorded
end note

component Demo <<RO App>> as APP
FE <-> APP : request / response

component "Apache Causeway" <<Naked Objects FW>> as FW
APP -> FW : uses


together {
    file RE as "
    .. (Sample) Replay Events..
    |= url |= [request data] |= state |= response |\n| http://localhost:8080/restful | uid/pw | SUCCESS | {jsonStr} |\n| http://localhost:8080/restful/menubars | n/a | ERROR | {another js} |
    "
    component "Demo \nRegression \nTest" as DRT
}
EL ->"export" RE


RE <- DRT : reads
DRT "invokes"->"RO API" APP : replay

note bottom of DRT
Event Log Entries are replayed during test.
Expected/actual responses are compared.

Events in state:
* SUCCESS -> expected == actual
* ERROR -> expected != actual
end note

note top of FW
additional
coverage
end note

note as NREG
Regressions can be
caused in either
end note
APP .. NREG
NREG .. FW

@enduml
----



