The landlord, H. Frank Jablonski and Barbara Jablonski, doing business as York Properties (York), brought a summary process action in the Quincy Division of the District Court Department based on nonpayment of rent. The tenant, Renate Casey, answered and counterclaimed that York had breached the warranty of habitability and the covenant of quiet *745enjoyment by failing to repair certain conditions in the premises. She also claimed retaliatory eviction and violation of G. L. c. 93A. Following a trial, the judge found in favor of York and entered judgment for possession and back rent. The judge also found in favor of York on Casey’s counterclaims. Casey moved to amend the judgment, pursuant to G. L. c. 239, § 8A, to permit her to pay the back rent into the court and avoid the judgment for possession. That motion was denied.
The Appellate Division of the District Court Department affirmed the judgment of the trial judge and dismissed Casey’s appeal. Casey appeals from that decision.
Facts. We summarize the trial judge’s findings of fact. Casey had been a tenant of York since October, 1989. She resided at Presidential Acres, a large apartment complex located in Randolph. Initially, her tenancy was under a lease, but she continued as a tenant-at-will, paying rent of $920 per month.2 Casey did not pay rent for July, August, September, and October, 2001, leaving a balance due York of $3,680. She was served with a notice to quit for nonpayment of rent on August 17, 2001, and a summary process complaint on September 5, 2001. On September 4, 2001, York received an unsigned letter, dated July 21, 2001, from Casey or from someone acting on her behalf, complaining of several problems with her apartment.3 The letter claimed that Casey was having problems with dryer-vent odors, leaky windows, bathtub drainage, a tom linoleum floor, ant infestation, a noisy refrigerator, cracks in her walls, and a leaky toilet. The Randolph board of health conducted an inspection of the premises on September 8 and documented several of Casey’s complaints. A list of these itemized and documented complaints was sent to York. A reinspection was conducted on September 22, and the board of health found that York had made all the requested repairs with the exception of some remaining cracks in the walls, some dirt falling from a bathroom ceiling fan, and some evidence of ant infestation. York replaced the kitchen floor, replaced windows in two *746bedrooms, installed a new refrigerator, sanded and repainted the walls, repaired the toilet, replaced the motors in the ceiling fans, and twice exterminated for ants in Casey’s apartment and in the entire building.
Warranty of habitability. During the rental of any premises for residential purposes, whether pursuant to a written or oral lease and whether for a specified term or as a tenant at will, there exists an implied warranty of habitability requiring “that the premises are fit for human occupation.” Boston Hous. Authy. v. Hemingway, 363 Mass. 184, 199 (1973). “This means that at the inception of the rental there are no latent [or patent] defects in facilities vital to the use of the premises for residential purposes and that these essential facilities will remain during the entire term in a condition which makes the property livable.” Ibid.., quoting from Kline v. Burns, 111 N.H. 87, 92 (1971). Our modem view has determined that a residential lease is a contract between a landlord and a tenant. The landlord promises to provide and maintain residential premises in a habitable condition. The tenant promises to pay the agreed upon rent for the habitable premises. “These promises constitute interdependent and mutual considerations. Thus, the tenant’s obligation to pay rent is predicated on the landlord’s obligation to deliver and maintain the premises in habitable condition.” Id. at 198. We have required a material and substantial breach of the warranty, representing a significant defect in the property itself, in order to excuse the tenant’s obligation to pay rent. For example, “[a] dwelling afflicted with a substantial Sanitary Code violation is not habitable.” Berman & Sons, Inc. v. Jefferson, 379 Mass. 196, 201-202 (1979).
The existence of a material or substantial breach is a question of fact and must be determined in the circumstances and facts of each case. “Factors . . . aiding the court’s determination of the materiality of an alleged breach . . . include: (a) the seriousness of the claimed defects and their effect on the dwelling’s habitability; (b) the length of time the defects persist; (c) whether the landlord . . . received written or oral notice of the defects; (d) [whether] the residence could be made habitable within a reasonable time; and (e) whether the defects resulted from abnormal conduct or use by the tenant.” Boston Hous. Authy. v. Hemingway, supra at 200-201 (footnotes omitted).
*747Here, Casey argues that, based upon the report from the board of health substantiating certain of the complaints of Sanitary Code violations, the trial judge was required to find that York had breached the warranty of habitability. Not every violation of the Sanitary Code, however, will support a claim of breach of the warranty. See McAllister v. Boston Hous. Authy., 429 Mass. 300, 305 (1999).4 In her findings, the trial judge specifically found that Casey had failed to prove a breach of the warranty of habitability. Findings of fact will not be set aside unless they are clearly erroneous, bearing in mind the deference that must be given to the trial judge’s opportunity to weigh the credibility of the witnesses. See Mattoon v. Pittsfield, 56 Mass. App. Ct. 124, 139 (2002); Mass.R.Civ.P. 52(a), as amended, 423 Mass. 1402 (1996). “A finding is ‘clearly erroneous’ when although there is evidence to support it, the reviewing court on the entire evidence is left with the definite and firm conviction that a mistake has been committed.” United States v. United States Gypsum Co., 333 U.S. 364, 395 (1948). See Commonwealth v. Boncore, 412 Mass. 1013, 1014 (1992) (“[c]redibility is for the fact finder, not an appellate court”). We conclude, based on our review of the trial judge’s findings of fact and the evidence supporting them, that she did not err in ruling that there was no breach of the warranty of habitability applicable to Casey’s premises.
Casey’s remaining counterclaims. Casey counterclaimed that York breached her covenant of quiet enjoyment. Similar to the warranty of habitability, during the rental of any residential premises, there exists an implied covenant and a statutory right of quiet enjoyment. See Simon v. Solomon, 385 Mass. 91, 102 (1982); G. L. c. 186, § 14.5 We have interpreted this obligation to mean that the covenant of quiet enjoyment protects a tenant *748from serious interference with her tenancy. See Doe v. New Bedford Hous. Authy., 417 Mass. 273, 285 (1994). Generally, the landlord must have had notice of the condition interfering with the tenant’s quiet enjoyment of the premises, and he must have at least acted negligently in not alleviating the condition. See Al-Ziab v. Mourgis, 424 Mass. 847, 850-851 (1997).
Here, York acted immediately upon being notified by Casey of the defective conditions. While these conditions were documented by the board of health pursuant to an inspection, a reinspection less than two weeks later indicated that substantially all the conditions had been satisfactorily addressed. The trial judge did not err in denying the requested ruling of law that a breach of the covenant of quiet enjoyment had occurred. We see no evidence in the record before us of interference with Casey’s quiet enjoyment of the premises.
We also conclude, after reviewing the evidence, that Casey was not entitled to prevail on her counterclaim for retaliatory eviction. See G. L. c. 186, § 18; G. L. c. 239, § 2A. Casey argues that her eviction was in retaliation for signing a petition in November, 2000, complaining of conditions in several of the apartments at Presidential Acres. The trial judge, however, did not find that this petition was ever sent to York. Even if York had received the petition in November, 2000, the eviction would not be presumed to have been retaliatory because the eviction process did not begin until August, 2001, more than six months later. See G. L. c. 186, § 18 (notice by landlord of termination of tenancy within six months after tenant complains of conditians in apartment creates “rebuttable presumption that such notice ... is a reprisal against the tenant”). Furthermore, when, as here, the eviction is based on nonpayment of rent, a finding of retaliation will not normally lie. See ibid.
Finally, in the absence of a breach of the warranty of habitability or the covenant of quiet enjoyment, and with no finding of retaliatory eviction by York, we agree with the trial judge that no violation of G. L. c. 93A, § 2(a), occurred.
Motion for possession. Casey argues that she is entitled to *749reinstatement of her tenancy pursuant to G. L. c. 239, § 8A.6 The statute allows a tenant to withhold rent because of conditions “that . . . endanger or materially impair the [tenant’s] health, safety or well-being.” G. L. c. 239, § 8A, third par., as amended by St. 1977, c. 963. Generally, if the final disposition of the matter results in a judgment in favor of the landlord, the tenant has one week to reinstate her tenancy by paying the amount of the judgment into court. The landlord, however, must be notified of any such condition before the tenant is allowed to withhold her rent. Here, the trial judge found that York did not have notice of the complained of conditions until September 4, 2001, some two months into Casey’s rent arrearage and after she had received a notice to quit. We have found no reason in our review of the evidence to dispute this finding and conclude, therefore, that it was not clearly erroneous. The statute states that “[w]henever any counterclaim or claim of defense under this section is based on any allegation concerning the condition of the premises . . ., the tenant or occupant shall not be entitled to relief under this section unless: (1) the owner or his agents, servants, or employees, or the person to whom the tenant or occupant customarily paid his rent knew of such conditions before the tenant or occupant was in arrears in his rent” (emphasis added). G. L. c. 239, § 8A, second par., as amended by St. 1987, c. 773, § 15.7 Casey cannot avail herself of the statute’s remedial provisions and protections in the absence of her compliance with its procedural requirements. She cannot withhold her rent without justification and expect to retain possession of the rented premises. In these circumstances, she could *750not retain possession of her premises even if York had breached the warranty of habitability. “If the tenant fails to follow c. 239, § 8A’s procedures, [her] refusal to pay some or all of the rent due will subject [her] to eviction proceedings to which [she] will have no defen[s]e. . . . [S]he cannot use the landlord’s [alleged] breach of the habitability warranty as a defen[s]e to a notice to quit for nonpayment of rent.” Boston Hous. Authy. v. Hemingway, 363 Mass. at 202-203.
Upon review of all the evidence, we conclude that the trial judge did not abuse her discretion and that there was sufficient evidence to support her findings.
Decision and order of the Appellate Division of the District Court Department affirmed.
Casey received notice of a rent increase to $970 effective August 1, 2001, but there is no evidence she accepted this increase.
The trial judge found that while the letter was dated July 21, 2001, York did not receive it until September 4, 2001.
For illustrations of significant defects in the property itself, see, e.g., Crowell v. McCaffrey, 377 Mass. 443, 451 (1979) (defective railing on third floor porch); Simon v. Solomon, 385 Mass. 91, 93, 96 (1982) (water and sewage repeatedly flooded apartment); Cruz Mgmt. Co. v. Thomas, 417 Mass. 782, 787 (1994) (apartment lacked adequate heat, hot water, and fire escape; was infested with cockroaches, mice, and rats; had unsanitary common areas; and had defective smoke detector, windows, and wiring).
In relevant part, G. L. c. 186, § 14, as amended by St. 1974, c. 192, § 1, provides, “[A]ny lessor or landlord who directly or indirectly interferes with the quiet enjoyment of any residential premises by the occupant. . . shall be *748punished by a fine of not less than twenty-five dollars nor more than three hundred dollars, or by imprisonment for not more than six months.”
GeneraI Laws c. 239, § 8A, fifth par., as amended by St. 1981, c. 133, reads in pertinent part:
“If the amount found to be due the landlord exceeds the amount found to be due the tenant or occupant, there shall be no recovery of possession if the tenant or occupant, within one week after having received written notice from the court of the balance due, pays to the clerk the balance due the landlord, together with interest and costs of suit, less any credit due the tenant or occupant for funds already paid by him to the clerk under this section.”
The statute has several other procedural requirements with which Casey may or may not have complied.