The American Civil Liberties Union sued to challenge the law. A federal judge in Florida temporarily blocked the law last year pending the outcome of that challenge.
Florida appealed that block to the 11th U.S. Circuit Court of Appeals, which heard arguments Thursday.
The ACLU argues the testing violates constitutional protection against unreasonable searches. Florida has argued that the law would save money and is necessary to ensure that welfare programs serve their purpose of getting people back to work and protecting children.
The ultimate outcome could affect similar efforts in other states.