Skip to content

Commit a00ecee

Browse files
committed
Add Testing and Documentation sections to README, add THIRD-PARTY file
1 parent 327e21a commit a00ecee

File tree

2 files changed

+233
-0
lines changed

2 files changed

+233
-0
lines changed

README.md

+30
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,36 @@ Options:
127127
--help, -h: Print this help message and exit.
128128
```
129129

130+
## Testing
131+
132+
Our test suite is divided into unit tests and "functional" tests. By "functional", we mean tests that verify the
133+
expected behavior of the algorithms defined in the package. For example, a functional test for the anomaly detection
134+
algorithm will first train a forest on a pre-defined distribution and then verify that the forest assigns a high
135+
anomaly score to anomalous points (where "anomalous" is with respect to the specified distribution). Functional tests
136+
are indicated both in the test class name (e.g., `RandomCutForestFunctionalTest`) and in a `@Tag` annotation on the
137+
test class.
138+
139+
The full test suite including functional test currently takes over 10 minutes to complete. If you are contributing to
140+
this package, we recommend excluding the functional tests while actively developing, and only running the full test
141+
suite before creating a pull request. Functional tests can be excluded from Maven build targets by passing
142+
`-DexcludedGroups=functional` at the command line. For example:
143+
144+
```text
145+
% mvn test -DexcludedGroups=functional
146+
```
147+
148+
We currently have 90% line coverage with the full test suite, and 80% line coverage when running the unit tests only
149+
(i.e., when excluding functional tests). Our goal is to reach 100% unit test coverage, and we welcome (and encourage!)
150+
test contributions. After running tests with Maven, you can see the test coverage broken out by class by opening
151+
`target/site/jacoco/index.html` in a web browser.
152+
153+
Our tests are implemented in [JUnit 5](https://junit.org/junit5/) with [Mockito](https://site.mockito.org/), [Powermock](https://github.com/powermock/powermock), and [Hamcrest](http://hamcrest.org/) for testing.
154+
Test dependencies will be downloaded automatically when invoking `mvn test` or `mvn package`.
155+
156+
## Documentation
157+
158+
* Guha, S., Mishra, N., Roy, G., & Schrijvers, O. (2016, June). Robust random cut forest based anomaly detection on streams. In *International conference on machine learning* (pp. 2712-2721).
159+
130160
## Code of Conduct
131161

132162
This project has adopted an [Open Source Code of Conduct](https://aws.github.io/code-of-conduct).

THIRD-PARTY

+203
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
** Gson 2.8; version 2.8.6 -- https://github.com/google/gson
2+
Copyright 2008 Google Inc.
3+
4+
Apache License
5+
6+
Version 2.0, January 2004
7+
8+
http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND
9+
DISTRIBUTION
10+
11+
1. Definitions.
12+
13+
"License" shall mean the terms and conditions for use, reproduction, and
14+
distribution as defined by Sections 1 through 9 of this document.
15+
16+
"Licensor" shall mean the copyright owner or entity authorized by the
17+
copyright owner that is granting the License.
18+
19+
"Legal Entity" shall mean the union of the acting entity and all other
20+
entities that control, are controlled by, or are under common control
21+
with that entity. For the purposes of this definition, "control" means
22+
(i) the power, direct or indirect, to cause the direction or management
23+
of such entity, whether by contract or otherwise, or (ii) ownership of
24+
fifty percent (50%) or more of the outstanding shares, or (iii)
25+
beneficial ownership of such entity.
26+
27+
"You" (or "Your") shall mean an individual or Legal Entity exercising
28+
permissions granted by this License.
29+
30+
"Source" form shall mean the preferred form for making modifications,
31+
including but not limited to software source code, documentation source,
32+
and configuration files.
33+
34+
"Object" form shall mean any form resulting from mechanical
35+
transformation or translation of a Source form, including but not limited
36+
to compiled object code, generated documentation, and conversions to
37+
other media types.
38+
39+
"Work" shall mean the work of authorship, whether in Source or Object
40+
form, made available under the License, as indicated by a copyright
41+
notice that is included in or attached to the work (an example is
42+
provided in the Appendix below).
43+
44+
"Derivative Works" shall mean any work, whether in Source or Object form,
45+
that is based on (or derived from) the Work and for which the editorial
46+
revisions, annotations, elaborations, or other modifications represent,
47+
as a whole, an original work of authorship. For the purposes of this
48+
License, Derivative Works shall not include works that remain separable
49+
from, or merely link (or bind by name) to the interfaces of, the Work and
50+
Derivative Works thereof.
51+
52+
"Contribution" shall mean any work of authorship, including the original
53+
version of the Work and any modifications or additions to that Work or
54+
Derivative Works thereof, that is intentionally submitted to Licensor for
55+
inclusion in the Work by the copyright owner or by an individual or Legal
56+
Entity authorized to submit on behalf of the copyright owner. For the
57+
purposes of this definition, "submitted" means any form of electronic,
58+
verbal, or written communication sent to the Licensor or its
59+
representatives, including but not limited to communication on electronic
60+
mailing lists, source code control systems, and issue tracking systems
61+
that are managed by, or on behalf of, the Licensor for the purpose of
62+
discussing and improving the Work, but excluding communication that is
63+
conspicuously marked or otherwise designated in writing by the copyright
64+
owner as "Not a Contribution."
65+
66+
"Contributor" shall mean Licensor and any individual or Legal Entity on
67+
behalf of whom a Contribution has been received by Licensor and
68+
subsequently incorporated within the Work.
69+
70+
2. Grant of Copyright License. Subject to the terms and conditions of this
71+
License, each Contributor hereby grants to You a perpetual, worldwide,
72+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
73+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
74+
sublicense, and distribute the Work and such Derivative Works in Source or
75+
Object form.
76+
77+
3. Grant of Patent License. Subject to the terms and conditions of this
78+
License, each Contributor hereby grants to You a perpetual, worldwide,
79+
non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
80+
this section) patent license to make, have made, use, offer to sell, sell,
81+
import, and otherwise transfer the Work, where such license applies only to
82+
those patent claims licensable by such Contributor that are necessarily
83+
infringed by their Contribution(s) alone or by combination of their
84+
Contribution(s) with the Work to which such Contribution(s) was submitted.
85+
If You institute patent litigation against any entity (including a
86+
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
87+
Contribution incorporated within the Work constitutes direct or contributory
88+
patent infringement, then any patent licenses granted to You under this
89+
License for that Work shall terminate as of the date such litigation is
90+
filed.
91+
92+
4. Redistribution. You may reproduce and distribute copies of the Work or
93+
Derivative Works thereof in any medium, with or without modifications, and
94+
in Source or Object form, provided that You meet the following conditions:
95+
96+
(a) You must give any other recipients of the Work or Derivative Works a
97+
copy of this License; and
98+
99+
(b) You must cause any modified files to carry prominent notices stating
100+
that You changed the files; and
101+
102+
(c) You must retain, in the Source form of any Derivative Works that You
103+
distribute, all copyright, patent, trademark, and attribution notices
104+
from the Source form of the Work, excluding those notices that do not
105+
pertain to any part of the Derivative Works; and
106+
107+
(d) If the Work includes a "NOTICE" text file as part of its
108+
distribution, then any Derivative Works that You distribute must include
109+
a readable copy of the attribution notices contained within such NOTICE
110+
file, excluding those notices that do not pertain to any part of the
111+
Derivative Works, in at least one of the following places: within a
112+
NOTICE text file distributed as part of the Derivative Works; within the
113+
Source form or documentation, if provided along with the Derivative
114+
Works; or, within a display generated by the Derivative Works, if and
115+
wherever such third-party notices normally appear. The contents of the
116+
NOTICE file are for informational purposes only and do not modify the
117+
License. You may add Your own attribution notices within Derivative Works
118+
that You distribute, alongside or as an addendum to the NOTICE text from
119+
the Work, provided that such additional attribution notices cannot be
120+
construed as modifying the License.
121+
122+
You may add Your own copyright statement to Your modifications and may
123+
provide additional or different license terms and conditions for use,
124+
reproduction, or distribution of Your modifications, or for any such
125+
Derivative Works as a whole, provided Your use, reproduction, and
126+
distribution of the Work otherwise complies with the conditions stated in
127+
this License.
128+
129+
5. Submission of Contributions. Unless You explicitly state otherwise, any
130+
Contribution intentionally submitted for inclusion in the Work by You to the
131+
Licensor shall be under the terms and conditions of this License, without
132+
any additional terms or conditions. Notwithstanding the above, nothing
133+
herein shall supersede or modify the terms of any separate license agreement
134+
you may have executed with Licensor regarding such Contributions.
135+
136+
6. Trademarks. This License does not grant permission to use the trade
137+
names, trademarks, service marks, or product names of the Licensor, except
138+
as required for reasonable and customary use in describing the origin of the
139+
Work and reproducing the content of the NOTICE file.
140+
141+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
142+
writing, Licensor provides the Work (and each Contributor provides its
143+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
144+
KIND, either express or implied, including, without limitation, any
145+
warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
146+
FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining
147+
the appropriateness of using or redistributing the Work and assume any risks
148+
associated with Your exercise of permissions under this License.
149+
150+
8. Limitation of Liability. In no event and under no legal theory, whether
151+
in tort (including negligence), contract, or otherwise, unless required by
152+
applicable law (such as deliberate and grossly negligent acts) or agreed to
153+
in writing, shall any Contributor be liable to You for damages, including
154+
any direct, indirect, special, incidental, or consequential damages of any
155+
character arising as a result of this License or out of the use or inability
156+
to use the Work (including but not limited to damages for loss of goodwill,
157+
work stoppage, computer failure or malfunction, or any and all other
158+
commercial damages or losses), even if such Contributor has been advised of
159+
the possibility of such damages.
160+
161+
9. Accepting Warranty or Additional Liability. While redistributing the Work
162+
or Derivative Works thereof, You may choose to offer, and charge a fee for,
163+
acceptance of support, warranty, indemnity, or other liability obligations
164+
and/or rights consistent with this License. However, in accepting such
165+
obligations, You may act only on Your own behalf and on Your sole
166+
responsibility, not on behalf of any other Contributor, and only if You
167+
agree to indemnify, defend, and hold each Contributor harmless for any
168+
liability incurred by, or claims asserted against, such Contributor by
169+
reason of your accepting any such warranty or additional liability. END OF
170+
TERMS AND CONDITIONS
171+
172+
APPENDIX: How to apply the Apache License to your work.
173+
174+
To apply the Apache License to your work, attach the following boilerplate
175+
notice, with the fields enclosed by brackets "[]" replaced with your own
176+
identifying information. (Don't include the brackets!) The text should be
177+
enclosed in the appropriate comment syntax for the file format. We also
178+
recommend that a file or class name and description of purpose be included on
179+
the same "printed page" as the copyright notice for easier identification
180+
within third-party archives.
181+
182+
Copyright [yyyy] [name of copyright owner]
183+
184+
Licensed under the Apache License, Version 2.0 (the "License");
185+
186+
you may not use this file except in compliance with the License.
187+
188+
You may obtain a copy of the License at
189+
190+
http://www.apache.org/licenses/LICENSE-2.0
191+
192+
Unless required by applicable law or agreed to in writing, software
193+
194+
distributed under the License is distributed on an "AS IS" BASIS,
195+
196+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
197+
198+
See the License for the specific language governing permissions and
199+
200+
limitations under the License.
201+
202+
* For Gson 2.8 see also this required NOTICE:
203+
Copyright 2008 Google Inc.

0 commit comments

Comments
 (0)