189 F.3d 820 (9th Cir. 1999)
UNITED STATES OF AMERICA, Plaintiff-Appellee,v.JOHNTAI EDWARD JACKSON, Defendant-Appellant.
No. 98-50361
UNITED STATES COURT OF APPEALS FOR THE NINTH CIRCUIT
Argued and Submitted June 10, 1999Filed August 31, 1999

Emily Uhrig, Deputy Federal Public Defender, Los Angeles, California, for the defendant-appellant.
Edward B. Moreton, Jr., Assistant United States Attorney, Los Angeles, California, for the plaintiff-appellee.
Appeal from the United States District Court for the Central District of California Ronald S. W. Lew, District Judge, Presiding.  D.C. No. CR 97-00672-RSWL-01.
Before: Alex Kozinski and Ferdinand F. Fernandez, Circuit Judges, andWilliam B. Shubb,* District Judge.
SHUBB, District Judge:
Johntai Edward Jackson appeals his sentence, which imposed as a condition of supervised release that he submit to drug testing upon release from prison and at least twice there- after. Because we find that the court properly applied the 1997 United States Sentencing Guidelines in effect at the time of Jackson's sentencing, which require drug testing as a mandatory condition of supervised release, we conclude that the court did not abuse its discretion. Accordingly, the sentence is affirmed.
I.
Between July and November of 1992, Jackson submitted false loan applications to the Small Business Administration and First Interstate Bank, claiming his business had been destroyed by fire in the 1992 Los Angeles riots. In truth, Jack- son had suffered no such losses. Jackson pleaded guilty to two counts: (1) making a false claim to an agency of the United States, in violation of 18 U.S.C. S 287, and (2) making a materially false statement to a financial institution insured by the Federal Deposit Insurance Corporation, in violation of 18 U.S.C. S 1014. Pursuant to his plea agreement, Jackson waived his right to appeal "any sentence imposed by the Court," as long as the total offense level was determined to be 13 or below1.
At sentencing, the district court determined the total offense level to be 13, sentenced Jackson to a fifteen-month term of imprisonment, ordered that he pay $211,691.97 in restitution, and imposed a five-year term of supervised release. One of the conditions of supervised release was that Jackson submit to drug testing upon release from prison and at least twice thereafter.
Jackson objects to the drug testing condition on the grounds that he has no history of drug abuse and the offenses for which he was convicted do not relate to drug use. Jackson's argument rests on the assumption that the sentencing guidelines in effect in 1992, under which the drug testing condition was discretionary rather than mandatory, applied to his sentencing.
II.
Whether imposition of the drug testing condition was mandatory or discretionary depends on which version of the sentencing guidelines applied to Jackson's sentencing. Under the 1992 guidelines, the sentencing court has discretion to impose drug testing as a condition of supervised release. 18 U.S.C. S 3583(d)(1992); United States Sentencing Commission, Guidelines Manual ("USSG") S 5D1.3(b)(Nov. 1992). In contrast, under the 1997 guidelines, drug testing is a mandatory condition of supervised release. 18 U.S.C.S 3583(d) (1998); USSG S 5D1.3(a)(4)(Nov. 1997).
Generally, the guidelines in effect at the time of sentencing apply. USSG S 1B1.11(a). However, when application of the guidelines in effect at the time of sentencing would violate the Ex Post FactoClause of the United States Constitution, the court must use the guidelines in effect at the time of the commission of the offense. USSG S 1B1.11(b)(1); see U.S. Const. art. I, S 9, cl. 3.
As applied to Jackson, the only relevant difference between the 1997 and 1992 guidelines is the change making imposition of the drug testing condition mandatory.2 We inquire whether this change requires application of the 1992 guidelines, in light of the Ex Post Facto Clause.
The Ex Post Facto Clause of the United States Constitution forbids the application of a law to "retroactively alter the definition of crimes or increase the punishment for criminal acts." California Dep't of Corrections v. Morales, 514 U.S. 499, 504, 115 S. Ct. 1597, 1601, 131 L. Ed. 2d 588 (1995) (quoting Collins v. Youngblood, 497 U.S. 37, 43, 110 S. Ct. 2715, 2719, 111 L. Ed. 2d 30 (1990)). For the Ex Post Facto Clause to apply here, drug testing as a mandatory condition of supervised release must constitute "punishment." See Russell v. Gregoire, 124 F.3d 1079, 1083 (9th Cir. 1997), cert. denied, 118 S. Ct. 1191 (1998).
To determine whether a provision constitutes "punishment," the court asks (1) whether the legislature intended the provision to be punitive; and (2) whether the pro- vision is punitive in effect. Russell, 124 F.3d at 1086-87 (comparing Kansas v. Hendricks, 521 U.S. 346, 361-63, 117 S. Ct. 2072, 2081 83, 138 L. Ed. 2d 501 (1997), with United States v. Ursery, 518 U.S. 267, 288-92, 116 S. Ct. 2135, 2147-49, 135 L. Ed. 2d 549 (1996), and dubbing these cases' approach the "intent-effects" test); see also United States v. Newman, 144 F.3d 531, 540 (7th Cir. 1998) (applying the intent-effects test in the context of criminal sentencing).
A. Intent
The language of the mandatory drug testing provision itself does not evidence either a punitive or non-punitive intent. 18 U.S.C. S 3583(d) (1998); see also USSG S 5D1.3(a)(4) (Nov. 1997).3 The structure of the statute in which the drug testing condition is found, however, indicates that supervised release is meant to further non-punitive purposes. Subsection (d) is within the statute that concerns supervised release generally. 18 U.S.C. S 3583. In imposing a term of supervised release, ordering discretionary conditions of supervised release, and modifying the conditions, the courts are to consider, among other things, the deterrent, protective, and rehabilitative purposes of sentencing; however, they arenot to consider the factor identified in 18 U.S.C. S 3553(a)(2)(A), that is, the need "to reflect the seriousness of the offense, to promote respect for the law, and to provide just punishment for the offense." See 18 U.S.C. S 3583(c), (d), & (e) (each listing the factors from Section 3553(a) that are to be considered and each omitting Section 3553(a)(2)(A)). The fact that Congress placed the requirement that courts impose the drug testing condition within this statute suggests a non- punitive purpose for it.
B. Effects
Although Congress has not manifested an intent that the drug testing condition bepunitive, we nevertheless inquire whether the condition is so punitive in effect as to overcome a non-punitive legislative intent. Hendricks, 521 U.S. at 361, 117 S. Ct. at 2082; Russell, 124 F.3d at 1088. In determining the nature of a law's effects, courts have looked to the helpful, but not dispositive, factors articulated in Kennedy v. Mendoza-Martinez, 372 U.S. 144, 83 S. Ct. 554, 9 L. Ed. 2d 644 (1963):
Whether the sanction involves an affirmative disability or restraint, whether it has historically been regarded as a punishment, whether it comes into play only on a finding of scienter, whether its operation will promote the traditional aims of punishment-- retribution and deterrence, whether the behavior to which it applies is already a crime, whether an alter- native purpose to which it may rationally be connected is assignable for it, and whether it appears excessive in relation to the alternative purpose assigned[.]
Id. at 168-69, 83 S. Ct. at 567-68 (footnotes omitted).
Historically, conditions of supervised release, and drug testing among them, have not been regarded as punishment, but instead as means to further the deterrent, protective, and rehabilitative goals of sentencing. See United States v. Eyler, 67 F.3d 1386, 1393 (9th Cir. 1995). Indeed, drug testing has not been limited to the criminal justice system. Outside the context of criminal sentencing, employees, job applicants, and student athletes routinely submit to mandatory drug testing.


1
The drug testing condition does not serve one of the traditional aims of punishment -- retribution. It is not geared toward making Jackson understand and regret the severity of his crimes. While it might deter future crime, this fact does not necessarily make the condition punitive, as deterrence may also serve non-punitive goals. See Ursery , 518 U.S. at 292, 116 S. Ct. at 2149; Russell, 124 F.3d at 1089.


2
The drug testing condition depends on a finding of scienter only in the sense that the underlying offense is a prerequisite to the condition. The fact that the condition is thereby related to Jackson's past criminal behavior does not suffice to make the condition punishment. See Ursery, 518 U.S. at 292, 116 S. Ct. at 2149; Russell, 124 F.3d at 1089.


3
Alternative purposes are rationally connected to the drug testing condition: to protect society from the future criminal behavior of drug abusers and to identify those who need treatment. The small affirmative restraint that a drug testing requirement imposes upon Jackson is not excessive in relation to these protective and rehabilitative alternative purposes. Cf. Hendricks, 521 U.S. at 363, 117 S. Ct. at 2083 (affirmative restraint of civil commitment not punitive in light of State's purpose to protect public); Rise v. State of Oregon, 59 F.3d 1556, 1562 (9th Cir. 1995) (taking of DNA sample not punitive because justified by State's purpose to identify, arrest, and prosecute criminals), cert. denied, 517 U.S. 1160 (1996).


4
On balance, the Mendoza-Martinez factors do not indicate that the drug testing condition has a punitive effect. There being no indication in either the intent or effects that the drug testing condition constitutes "punishment" for the purposes of the Ex Post Facto Clause, we find that the 1997 guidelines applied to Jackson's sentencing. See USSGS 1B1.11(a).4

III.

5
We review the district court's imposition of conditions of supervised releasefor abuse of discretion. United States v. Carter, 159 F.3d 397, 399 (9th Cir. 1998); United States v. Johnson, 998 F.2d 696, 697 (9th Cir. 1993). Since under the 1997 guidelines imposition of the drug testing condition is mandatory unless a low risk of future substance abuse is indicated, the district court did not abuse its discretion in ordering that Jackson submit to drug testing. Carter, 159 F.3d at 399- 400; see 18 U.S.C. SS 3583(d), 3563(a)(5) (1998). There was no evidence to establish that Jackson had a low risk for future substance abuse. See Carter, 159 F.3d at 400. Neither the fact that there was no evidence before the district court that Jack- son had abused drugs nor that his convictions were not drug related establishes that the court abused its discretion in imposing the condition. See id.  AFFIRMED.



Notes:


*
 The Honorable William B. Shubb, Chief Judge of the United States District Court for the Eastern District of California, sitting by designation.


1
 Both the merits of the appeal and the applicability of the waiver to the drug testing condition hinge on our determination that the 1997 sentencing guidelines applied to Jackson's sentencing. Since Jackson is presumed to be aware that his sentence will be controlled by the law in effect at the time of his sentencing, see United States v. Johnson, 67 F.3d 200, 202 (9th Cir. 1995), the determination that the 1997 guidelines applied indicates that the scope of his waiver extended to the mandatory drug testing condition. However, because this same determination also means that the judgment must be affirmed, we do not reach the question of waiver. See United States v. Bolinger, 940 F.2d 478, 480-81 (9th Cir. 1991) (affirming condition of probation despite express waiver of right to appeal sentence).


2
 The district court ordered Jackson to pay restitution in an amount agreed to in his plea agreement, pursuant to 18 U.S.C. S 3663(a)(3). As this provision existed in 1992, the restitution award does not implicate the Ex Post Facto Clause.


3
 Title 18, United States Code, Section 3583(d) reads in pertinent part: The court shall also order, as an explicit condition of supervised release, that the defendant refrain from any unlawful use of a controlled substance and submit to a drug test within 15 days of release on supervised release and at least 2 periodic drug tests thereafter (as determined by the court) for use of a controlled substance. The condition stated in the preceding sentence may be ameliorated or suspended by the court as provided in section 3563(a)(4) [sic: section 3563(a)(5)].  18 U.S.C. S 3583(d) (1998).


4
 Because we find that the drug testing condition does not constitute punishment, we do not reach the question of whether the change mandating the condition increases the quantum of punishment. But cf. United States v. Baggett, 125 F.3d 1319, 1322 (9th Cir. 1997) (assuming without analysis that an order to pay restitution constitutes punishment and proceeding to analyze whether the quantum of punishment was increased).


